Asked by John Rae
on 14 Oct 2018 at 4:34

I have to input a function where the output is reliant on the y-axis coordinate

Uwind = -75*(1-((75-y)/75)^2)

Is there any way that i can make the y value the y coordinate at any given point along the x axis?

Answer by madhan ravi
on 14 Oct 2018 at 4:52

Edited by madhan ravi
on 14 Oct 2018 at 5:09

syms y Uwind = -75*(1-((75-y)/75)^2) fplot(Uwind)

is this what you are looking for ? if not let know

John Rae
on 14 Oct 2018 at 6:22

madhan ravi
on 14 Oct 2018 at 6:26

can you show the code?

John Rae
on 14 Oct 2018 at 6:40

ax=-(D/m)*(vx*vx+vy*vy)^0.5*vx;

ay=-g-(D/m)*(vx*vx+vy*vy)^0.5*vy;

vx=Uwind+vx+ax*dt;

vy=vy+ay*dt;

x(i+1)=x(i)+vx*dt+.5*ax*dt^2;

y(i+1)=y(i)+vy*dt+.5*ay*dt^2;

t(i+1)=t(i)+dt;

i=i+1;

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 1 Comment

## madhan ravi (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/423875-how-do-i-input-the-y-coordinate-as-a-variable-in-matlab#comment_622114

Your code for better understanding.

Sign in to comment.