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

4 Ansichten (letzte 30 Tage)
a2zee
a2zee am 4 Sep. 2024
Bearbeitet: Voss am 23 Sep. 2024
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

Akzeptierte Antwort

Voss
Voss am 4 Sep. 2024
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 Kommentare
a2zee
a2zee am 4 Sep. 2024
It works! Thank you.
Voss
Voss am 4 Sep. 2024
Bearbeitet: Voss am 23 Sep. 2024
You're welcome! Any questions, let me know.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by