Convert a cell array (each cell having different no. of elements) to matrix

3 views (last 30 days)
I want to convert a cell array of (7886 x 1 cell) to matrix (7886 x :) whose no. of row elements are not consistent and are of a type double. Can anyone help how to convert this, as cell2mat does not support inconsistent no. of elements
A = cell2mat(b);
Error using cat
Dimensions of arrays being concatenated are not consistent.
Error in cell2mat (line 83)
m{n} = cat(1,c{:,n});

Accepted Answer

Stephen23 on 2 May 2022
Download PADCAT from here:
and use it like this:
A = padcat(b{:});

More Answers (0)




Community Treasure Hunt

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

Start Hunting!

Translated by