Why does the for loop show the graph of the last plot?
Ältere Kommentare anzeigen
Hi everyone.
My code is:
for i=46:52
plot(x,y1(:,i))
title("Title 1")
xlabel("xlabel1")
ylabel("ylabel1")
plot(x,y2(:,i))
title("Title 2")
xlabel("xlabel2")
ylabel("ylabel2")
end
Here x is a vector and y1, y2 are matrix. I intend to plot 14 different graphs of line (not in single figure, so didn't use hold on). But matlab executes only plot(x,y2(:,52)) and its title and labels. I would be grateful if someone could explain the reasoning.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Axis Labels finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!