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
dpb 2018 年 7 月 16 日
Attach a .mat file with the data for convenience...
Sophia Salazar
Sophia Salazar 2018 年 7 月 16 日
This is one of the arrays I'm working with

サインインしてコメントする。

採用された回答

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 Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by