creating 2D matrid from 3D matrix

I have a matrix F of size 201*3*201. I want to create another matrix Z of size 40401*3. I can do this as: Z=[F(:,:,1);F(:,:,2);......F(:,:,201)]; But how can I do this more quickly using loop or by any other tricks?

 채택된 답변

Walter Roberson
Walter Roberson 2011년 12월 22일

0 개 추천

Z = reshape( permute(F, [1 3 2]), [], 3);

댓글 수: 1

Bibek
Bibek 2011년 12월 23일
Thanks for your input. It worked for me exactly in the way I wish

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2011년 12월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by