Sorry if this is a bit of an elementary issue, but I could use some help concatenating a 3D matrix (20x12x30), A, into a 2D matrix (20x360),B, so that
B(:,1:12) = A(:,:,1)
B(:,13:24) = A(:,:,2)
etc.
I'm hoping to do this outside of a loop to save some computing time.

 채택된 답변

Image Analyst
Image Analyst 2014년 2월 17일

0 개 추천

Try this:
B = reshape(A, [20, 360])

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 17일

1 개 추천

A=rand(20,12,30)
B=A(:,:)

댓글 수: 1

Mariana
Mariana 2017년 11월 22일
This concatenate horizontally. How to concatenate vertically?

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

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2014년 2월 17일

댓글:

2017년 11월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by