How to plot each matrix in a cell?
6 views (last 30 days)
Show older comments
Hi everyone
I have a cell with size of 1x650 cell
And the size each matrix in the cell is 1x1300 double like this
A{n} = [1x1300 double] [1x1300 double] .... [1x1300 double]
Each matrix in the cell I have a graph
I want to plot all matrix in the cell into a figure
So how to plot the cell like this?
0 Comments
Accepted Answer
Simon
on 16 Sep 2013
Hi!
Create a figure, set it to "hold" (i.e. overwriting with subsequent plots) and plot
figure(1); cla; hold on;
cellfun(@(x) plot(x), A)
3 Comments
Simon
on 16 Sep 2013
figure(1); cla; hold on;
h = cellfun(@(x) plot(x), A);
This gives you the handle of each plot, in your case a vector of 650 handles. "h(100)" corresponds to "A{100}" and so on.
Knowing the handle you may change almost everything in the figure
% change color
set(h(100), 'Color', 'k')
% get values of plot
get(h(100), 'YData')
For further reading: http://www.mathworks.com/help/matlab/plot-objects-1.html, look at "Lineseries Properties"
More Answers (0)
See Also
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!