How to plot multiple curves on the same graph

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