How to plot multiple curves on the same graph

조회 수: 100 (최근 30일)
Darshan
Darshan 2022년 7월 8일
답변: Keshav 2022년 7월 8일
x = [1 2 3 4 5];
y = [7 8 9 10 11];
plot(x,y)
plot(y,x)
I want to plot these two curve on a single plot. can you please tell me how to do that?

채택된 답변

Keshav
Keshav 2022년 7월 8일
Hi, you can use the hold on function to plot both line on same graph. you can refer to the below code.
x = [1 2 3 4 5];
y = [7 8 9 10 11];
plot(x,y)
hold on
plot(y,x)
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