Plotting different vectors (length) into one single plot grpah

20 次查看(过去 30 天)
I have a problem when I try to make a plott with this code below.. I do know that it has all different size, but is there way to put them in one plot graph?
x1400 = [0;5;10;15];
x1300 = [0;5;10;15;20;25];
x1290 = [0;5;10;15;20;25];
y1400 = [0;991.99725;609.473;346.669];
y1300 = [0;101.1337;1956.477794;1350.206088;640.8293413];
y1290 = [0;0;453.36325;2104.90125;3358.576;1175.766];
plot(x1400,y1400);
hold on;
plot(x1300,y1300);
hold on;
plot(x1290,y1290);

回答(1 个)

Adam
Adam 2014-10-24
x1300 and y1300 are different lengths.
There is no problem plotting lines with different numbers of points on the same graph, but each line has to have the same number of points in its own (x,y) pair.

类别

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