how to cell array all data into a matrices

2 visualizaciones (últimos 30 días)
singh
singh el 29 de Abr. de 2015
Comentada: Star Strider el 29 de Abr. de 2015
A=CHM(cellfun(@(x)~isempty(x),CHM))
A =
[1x4 double] [19] [1x4 double] [1x4 double]
A{:}
ans =
1 2 14 16
ans =
19
ans =
6 12 15 20
ans =
3 4 7 17
how to get it into single matrix
B=[1,2,14,16,19,6,12,15,20,3,4,7,17]
strider plz check

Respuesta aceptada

Star Strider
Star Strider el 29 de Abr. de 2015
Slightly different with ‘A’ here, since it is a cell array of vectors and not a cell array of cells, so we do not need cell2mat this time:
B = horzcat(A{:})
produces:
B =
1 2 14 16 19 6 12 15 20 3 4 7 17
  2 comentarios
singh
singh el 29 de Abr. de 2015
thanks stinder
Star Strider
Star Strider el 29 de Abr. de 2015
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by