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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

17-Peridot

## PLOT 3 LEGS

1 ACCEPTED SOLUTION

Accepted Solutions
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).

5 REPLIES 5
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

19-Tanzanite
(To:ppal)

23-Emerald I
(To:ppal)

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

17-Peridot
(To:Fred_Kohlhepp)

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

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

Announcements
Top Tags