How to plot each matrix in a cell?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Simon
2013-9-16
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 个评论
Simon
2013-9-16
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"
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!