Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
@ppal wrote:
Thats good. But when leg = 3 it should put the point on the "Y" axis.
How can you expect a point (different from the origin) on the y-axis if you write a zero at the y placeholder???
Are there any more cases to come? leg=0, leg=4,5,... ?? What should happen if leg=6 or leg=-2 ?
You can make your function to return an appropriate 2x1 vector and plot its y-component over its x-component.
Or you may consider using appropriate complex numbers and plot Im(z) over Re(z).
Its unclear to me what you are trying to achieve. What kind of plot do you expect?
Your nested if's work OK but as you wrote it, "plots" gets the very same value (x=0.6) for LEG=2 and also for LEG=3 (and any other value different from 1) and so you see the very same plot (its just one point of course).
In the pic below I changed the value which is returned for LEG=3 (better: for any value of LEG not 1 or 2) to x/2
Thats good. But when leg = 3 it should put the point on the "Y" axis.
@ppal wrote:
Thats good. But when leg = 3 it should put the point on the "Y" axis.
How can you expect a point (different from the origin) on the y-axis if you write a zero at the y placeholder???
Are there any more cases to come? leg=0, leg=4,5,... ?? What should happen if leg=6 or leg=-2 ?
You can make your function to return an appropriate 2x1 vector and plot its y-component over its x-component.
Or you may consider using appropriate complex numbers and plot Im(z) over Re(z).