how to plot two variables having different length y1 it's size (1x1500) and y2 (1x1200) at the same figure according to steps in time (X-axis)
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ahmed Gharieb naga
am 1 Jul. 2023
Beantwortet: Voss
am 1 Jul. 2023
I'm actual doning random walk with different lengths and i want every variables has a color like this 

0 Kommentare
Akzeptierte Antwort
Voss
am 1 Jul. 2023
% two random vectors of different lengths
y1 = cumsum(randn(1,1500));
y2 = cumsum(randn(1,2000));
% plot them
plot(y1)
hold on
plot(y2)
xlabel('Step #')
ylabel('Position')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
