How to plot a 2d parametric equation

Equation is x=2t+4, y=t-1
This is what I did:
t=(1:5)
x=2t+4
t=t-1
plot (x,y)
And I obtained a diagonal line.
Note: t=(1:5) is not part of the exercise, I just added to see what could happen.

 采纳的回答

N = 100 ;
t = linspace(0,1,N) ;
x=2*t+4 ;
y=t-1 ;
plot(x,t)

2 个评论

Thanks! Could you tell me how to limit the graph to these values: -1<t<4 ?
You can write this on the line after the plot() command
ylim([-1 4]);

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by