How to plot a 2d parametric equation

198 visualizaciones (últimos 30 días)
MIGUEL HERNANDEZ
MIGUEL HERNANDEZ el 28 de Sept. de 2016
Editada: Rachel A. Eaglin el 19 de Feb. de 2021
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.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by