reshaping cell containing double arrays
Mostrar comentarios más antiguos
Hi,
I have (as an example) the following cell array:
test =
1×4 cell array
[40×1 double] [40×1 double] [40×1 double] [40×1 double]
I want test to be a 1 x 1 cell, containing the double arrays (from left to right) as one double array of dimension 160 x 1. reshape(test,[160,1]) does not work directly here. What can I do?
Respuestas (3)
Guillaume
el 10 de Oct. de 2017
That's because what you want is not reshaping but a concatenation. (The matrices may not be contiguous in memory):
test = [test{:}]
2 comentarios
MiauMiau
el 10 de Oct. de 2017
Oh yes, your vectors are column vectors. Concatenate them vertically then:
test = vertcat(test{:})
test = cell2mat(test');
this?
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!