I have a cell array with 10 cells and various values in each cell. I would like to make a stacked histogram of this data, where each cell is color coded to distinguish it from the others. Is there a way to do this on matlab?
2 次查看(过去 30 天)
显示 更早的评论
I have a cell array with 10 cells and various values in each cell. I would like to make a stacked histogram of this data, where each cell is color coded to distinguish it from the others. Is there a way to do this on matlab?
2 个评论
采纳的回答
dpb
2018-7-16
Is this what you had in mind, perhaps?
load risetime
n=cellfun(@numel,risetime);
nMax=max(n);
aug=cellfun(@(r,n) cat(2,r,nan(1,nMax-n)),risetime,num2cell(n),'uni',0);
r=reshape(cell2mat(aug),47,[]).';
bar(r.','stacked')
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!