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

조회 수: 2 (최근 30일)
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?

채택된 답변

KL
KL 2017년 12월 13일
if C is your cell array,
x = cellfun(@(x)reshape(x,size(x,1),[]),C,'uni',0)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by