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 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

dpb
dpb el 16 de Jul. de 2018
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')

Más respuestas (0)

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by