How to concatenate the resulting 2D matrices from a 3D matrix, vertically? Please, I need the solution for a gereric dimension n, i.e., A(:,:,n)

조회 수: 5 (최근 30일)
%example
for a=1:n
for c=1:n
H1(c,a,a)=1;
H1(c,c,a)=-1;
end
end
  댓글 수: 1
Mariana
Mariana 2017년 11월 23일
With H1(:,:) result and nx(nxn) 2D matrix. This concatenate the 3D matrix horizontally.
But, what about vertically.

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2017년 11월 23일
Hcell=num2cell(H1,[1,2]);
result=vertcat(Hcell{:});

추가 답변 (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