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

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

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by