How to input multiple lines on a graph

조회 수: 3 (최근 30일)
Ashley Megow
Ashley Megow 2020년 10월 22일
답변: Monisha Nalluru 2020년 10월 28일
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
Rik
Rik 2020년 10월 22일
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 2020년 10월 22일

댓글을 달려면 로그인하십시오.

채택된 답변

Monisha Nalluru
Monisha Nalluru 2020년 10월 28일
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

추가 답변 (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