MATLAB: How to count the amount of cells

count cell aray

Hi
I have a cell array, 1x 90. eacht of them has diff set of data,
for example, 1×1 has 10 cells , 1×2 5 cell etcs.
i want to count to count the amount of cells
numel(cellarrayname) gives 90… thats not what i want.
it should count every cell array add cellarray 2 +cell aray 3 etc..

Best Answer

your_count = cellfun(@(x) numel(x),your_cell_array);