How to plot a 2d parametric equation

128 次查看(过去 30 天)
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.

采纳的回答

KSSV
KSSV 2016-9-28
N = 100 ;
t = linspace(0,1,N) ;
x=2*t+4 ;
y=t-1 ;
plot(x,t)
  2 个评论
MIGUEL HERNANDEZ
MIGUEL HERNANDEZ 2016-9-29
Thanks! Could you tell me how to limit the graph to these values: -1<t<4 ?
Rachel A. Eaglin
Rachel A. Eaglin 2021-2-19
编辑:Rachel A. Eaglin 2021-2-19
You can write this on the line after the plot() command
ylim([-1 4]);

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by