How to adjust plots with several subplots with different loops?
Show older comments
Dear all,
I a have problem in adjusting the loop in the subplots and hope, that someone can help me with it.
What I would like to plot is:

However, I would like to automate and shorten it by loops with:

Unfortunately, the loop for the subplot does not match the loop for the y matrix, i.e., in subplot (1,3,1) I get the 3 times y(:,1) for the y axis instead of y(:,1), y(:,2), y(:,3). Is there a way to fix this or do I have to plot it individually ?
Thanks a lot for your help!
Regards,
Anna
Accepted Answer
More Answers (1)
ord={x,z,w};
for i=1:3
subplot(1,3,i);
h=plot(ord{i},y,'LineWidth',4);
[h.Color]=deal('cyan','red','blue');
end
Categories
Find more on Subplots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!