Code Comments
Programming Forum and web based access to our favorite programming groups.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!! ___________________________________ ------------------------------------ ____________________________________
Post Follow-up to this messageHi 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!! > > ___________________________________ > > ------------------------------------ > > ____________________________________
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.