How to concatenate elements of cell array

84 visualizaciones (últimos 30 días)
rob mccutcheon
rob mccutcheon el 12 de Mayo de 2017
Comentada: Aswathy el 29 de Ag. de 2024
Dear All,
I have what I expect is a simple problem that I would be most grateful for some help with.
I have a 333x1 cell array. Each of the 333 elements are a numeric array, ranging in dimensions from 49x332 to 49X1.
I would like to concatenate all the elements so that I have a single 49x55611 array.
Many thanks for any advice,
Rob

Respuesta aceptada

Stephen23
Stephen23 el 12 de Mayo de 2017
Editada: Stephen23 el 12 de Mayo de 2017
Where C is your cell array:
[C{:}]
or
horzcat(C{:})
For more info on how this works, read about comma separated lists:

Más respuestas (1)

KL
KL el 12 de Mayo de 2017
cell2mat(YourCellArray)

Categorías

Más información sobre Resizing and Reshaping Matrices 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