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

6 vues (au cours des 30 derniers jours)
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:
Error using cat
Dimensions of arrays being concatenated are not consistent.
Error in cell2mat (line 83)
m{n} = cat(1,c{:,n});

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by