Function that plots columns of data on a graph
1 view (last 30 days)
Show older comments
Bryan O'Donnell
on 5 Mar 2015
Commented: Star Strider
on 5 Mar 2015
I have matrix called M with 50 columns and about 5000 rows of data. I'm trying to create a function plotme(M,N) where N is the number of figures to be plotted.
Such that if I have plotme(M,5) 5 figures are created, each containing 10 columns of data. The first figure should plot columns 1-10, the second plots columns 11-20, and so on.
I'd appreciate any help with this. Thanks.
0 Comments
Accepted Answer
Star Strider
on 5 Mar 2015
Edited: Star Strider
on 5 Mar 2015
Not the full function, but a loop that will do the plotting:
M = randi(100, 100, 50);
NrFig = 5;
NrPlot = fix(size(M,2)/NrFig);
for k1 = 1:NrFig
idxrng = [1:NrPlot]+NrPlot*(k1-1)
figure(k1)
plot(M(:,idxrng))
end
11 Comments
More Answers (0)
See Also
Categories
Find more on Geographic Plots 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!