how to plot multiple curves on one graph

21 次查看(过去 30 天)
Hi,
I want to graph multiple curves on one graph. For example, one curve looks like:
x = [2,2,2,2,2]; (this represents number of vehicles)
y = [5,10,15,20,25]; (this represents number of nodes)
z = [6.3, 8.2, 7.3, 14.1, 73.4]; (this represents time taken)
This creates a curve that looks exponential, but I want to also overlay other curves like the following onto it (the overall graph should look almost like a ramp and a plot that shows the contour or surface would even be better).
x = [3,3,3,3,3];
y = [5,10,15,20,25];
z = [7.3, 10.2, 11.3, 22.1, 90.4]
Furthermore, if there is a way to fit an exponential curve to this, that would be even better.
Thank you so much for your help
Drew

回答(1 个)

Walter Roberson
Walter Roberson 2012-1-13
plot3(x1,y1,z1,'b*-',x2,y2,z2,'ro:');
or
plot3(x1,y1,z1,'b*-');
hold on
plot3(x2,y2,z2,'ro:');

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by