Plot multiple graphs on the figure using plot(y,linespec)

7 次查看(过去 30 天)
figure();
plot(y_vec_1,'*-r');gz;
xlabel('Wrap Around #'); ylabel('Time (Sec)');
How can I plot a second graph on the same figure? Also y_vec_x's dimension varies a bit.
plot(y_vec_2,'*-b');gz;
plot(y_vec_3,'*-g');gz;
Thanks

采纳的回答

Voss
Voss 2024-9-4
y_vec_1 = rand(1,10);
y_vec_2 = rand(1,15);
y_vec_3 = rand(1,20);
figure();
plot(y_vec_1,'*-r');%gz;
hold on
xlabel('Wrap Around #'); ylabel('Time (Sec)');
plot(y_vec_2,'*-b');%gz;
plot(y_vec_3,'*-g');%gz;

更多回答(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