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?

5 次查看(过去 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?

采纳的回答

dpb
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 个)

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by