cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

PLOT 3 LEGS

ppal
17-Peridot

PLOT 3 LEGS

ppal_0-1667789781087.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:ppal)


@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).

Werner_E_0-1667876027913.png

View solution in original post

5 REPLIES 5
Werner_E
24-Ruby V
(To:ppal)

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

Werner_E_0-1667805920176.png

 

ttokoro
20-Turquoise
(To:ppal)

image.pngimage.png

Fred_Kohlhepp
23-Emerald I
(To:ppal)

I've reworked your sheet.  Sorry if I misunderstood! 

Thats good. But when leg = 3 it should put the point on the "Y" axis.

Werner_E
24-Ruby V
(To:ppal)


@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).

Werner_E_0-1667876027913.png

Top Tags