How to Horizontally concatenate the values of a matrices present inside a cell array using loops?

1 visualización (últimos 30 días)
I have a 1x8 Cell Array(A) with elements composed of the following dimension.
10x13x2 double 10x13x2 double 10x13x2 double 10x13x2 double 10x13x2 double 10x13x2 double 10x13x2 double 10x13x2 double
where,
A(:,:,1) = 10x13 matrix(130 values)
A(:,:,2) = Another 10x13 Matrix(130 values)
Now i want to horizontally concatenate A(:,:,1) and A(:,:,2) so that i get a total of 260 values by concatenating 2 matrices in each cell. i need to concatenate it like say A(:,:,1) is M and A(:,:2) is V. so i need to concatenate horizontally like [M1 V1]..[MN VN].
So, finally i have to get an value of a 1x8 cell array like the below
MxNX1 MxNX1 MxNX1 MxNX1 MxNX1 MxNX1 MxNx1 MxNX1
where MXN = 260(130 + 130 Values concatenated horizontally),
Kindly suggest how to do this, if it involves reshaping and loops kindly suggest me how to do this?

Respuesta aceptada

KL
KL el 13 de Dic. de 2017
if C is your cell array,
x = cellfun(@(x)reshape(x,size(x,1),[]),C,'uni',0)

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating 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