Cell2mat with different rows

2 visualizaciones (últimos 30 días)
주희 박
주희 박 el 21 de Jun. de 2022
Comentada: 주희 박 el 21 de Jun. de 2022
Hi, I want to convert cell to array or double no matter except cell. So I tried cell2mat but I got an error because each cell has different rows.
I attached simple cell consist of different rows.
Thanks.

Respuesta aceptada

Stephen23
Stephen23 el 21 de Jun. de 2022
S = load('Cell.mat')
S = struct with fields:
A: {3×1 cell}
A = S.A
A = 3×1 cell array
{[ 1 2 3 1 2 3 1 2 3 1 2 3]} {[4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5]} {[ 6 7 8 9 10 6 6 6 6 6]}
M = padcat(A{:})
M = 3×22
1 2 3 1 2 3 1 2 3 1 2 3 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 6 7 8 9 10 6 6 6 6 6 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
  1 comentario
주희 박
주희 박 el 21 de Jun. de 2022
Thank you so much. This is what i want !

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion 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