How to input multiple lines on a graph

2 visualizaciones (últimos 30 días)
Ashley Megow
Ashley Megow el 22 de Oct. de 2020
Respondida: Monisha Nalluru el 28 de Oct. de 2020
I imported my data from excel, and i want to compare to different y values on a line graph. How to i add the second y value
  2 comentarios
Rik
Rik el 22 de Oct. de 2020
You mean you want to plot 2 lines on the same graph? Any basic Matlab toturial should teach you this. Have you done one?
Adam Danz
Adam Danz el 22 de Oct. de 2020

Iniciar sesión para comentar.

Respuesta aceptada

Monisha Nalluru
Monisha Nalluru el 28 de Oct. de 2020
In order to place mutliple plot on same figure we can use hold on functionality
As a example
x = linspace(-pi,pi);
y1 = sin(x);
y2 = cos(x);
plot(x,y1); % first line
hold on
plot(x,y2); % second line
hold off

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by