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?

채택된 답변

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