How do I make multiple figures from one matrix of data in a loop?
2 views (last 30 days)
Show older comments
I have a matrix of 4373x30 called X and need figure a plot for each three columns, so separate figures for columns 1-3, 4-6, 7-10 etc. I can of course write each plot out separately but this is very time consuming so there must be a way of putting it all in a for loop So far i have:
for i=1:3:28
for j=3:3:30
figure;
plot(X(:,i,j)
end
end
but this just plots hundreds of figures and I'm not sure why?
1 Comment
Stephen23
on 23 Feb 2015
Note that it is best to avoid using i and j for loop variable names, as these are both names of the inbuilt imaginary unit .
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!