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

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 日

0 投票

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;

2 件のコメント

a2zee
a2zee 2024 年 9 月 4 日
It works! Thank you.
Voss
Voss 2024 年 9 月 4 日
編集済み: Voss 2024 年 9 月 23 日
You're welcome! Any questions, let me know.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2024 年 9 月 4 日

編集済み:

2024 年 9 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by