Home > Archive > Matlab > May 2005 > A Simple Challenge To All Simulink Users! Can you do it??
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
A Simple Challenge To All Simulink Users! Can you do it??
|
|
| CHALLENGER 2005-05-31, 9:14 am |
| Hai there. I have a problem which is hard to solve although i have
ask many simulink users. Nobody have solve it yet. So i would like to
challenge you to solve the problem. The problem is to create three
lines, that is two stagnant lines and one moving line in 2D in
simulink using XY block. Currently, XY block only let you to plot one
line in a figure. When the simulation button is click, the three
lines must be appear in a figure.If you use the command 'hold on' in
matlab command window, three lines will be appear, but once you close
the figure and simulate again, only one line will be appear which
make you to type the hold on command again. Its not proffesional
right ! So, can you think how to solve it?? Nobody have solve it yet.
The diagram is shown below.The line in the middle is the moving line
while the other two lines are stagnant. Remember, use simulink XY
block. GOOD lUCK MY FRIENDS!!
___________________________________
------------------------------------
____________________________________
| |
| Frank Scretico 2005-05-31, 9:01 pm |
| Hi challenger... let's see if I' good enough to solve your problem.
Just a little trick: with a right-click on the XY block, you can
"look under mask", and you'll see that this block is just a call to
an s-function called "sfunxy".
Then the next step: edit sfunxy, save it with a DIFFERENT name,
modify it so that it accepts two more inputs (that will be your
boundaries), create a (masked) subsystem that replicates the XY block
but uses your custom sfunxy...
Does it solve your problem?
Cheers,
Frank
CHALLENGER wrote:
>
>
> Hai there. I have a problem which is hard to solve although i have
> ask many simulink users. Nobody have solve it yet. So i would like
> to
> challenge you to solve the problem. The problem is to create three
> lines, that is two stagnant lines and one moving line in 2D in
> simulink using XY block. Currently, XY block only let you to plot
> one
> line in a figure. When the simulation button is click, the three
> lines must be appear in a figure.If you use the command 'hold on'
> in
> matlab command window, three lines will be appear, but once you
> close
> the figure and simulate again, only one line will be appear which
> make you to type the hold on command again. Its not proffesional
> right ! So, can you think how to solve it?? Nobody have solve it
> yet.
> The diagram is shown below.The line in the middle is the moving
> line
> while the other two lines are stagnant. Remember, use simulink XY
> block. GOOD lUCK MY FRIENDS!!
>
> ___________________________________
>
> ------------------------------------
>
> ____________________________________
|
|
|
|
|