필터 지우기
필터 지우기

How to use Permute?

조회 수: 2 (최근 30일)
Bas
Bas 2015년 9월 9일
편집: John D'Errico 2015년 9월 9일
Hello,
I have a matrix A(2362x48) and I want to convert this into a 3D matrix B(2362X12X4). So I want all the rows of columns 1:12 of matrix A to be in B(:,:,1) and all rows of columns 13:24 of A in B(:,:,2) etc. Can anyone help me with this? I tried permute but get different matrices all the time..

채택된 답변

Sean de Wolski
Sean de Wolski 2015년 9월 9일
reshape(A,size(A,1),12,4)
  댓글 수: 1
John D'Errico
John D'Errico 2015년 9월 9일
편집: John D'Errico 2015년 9월 9일
+1. An excellent use for permute. :)
I suppose IF the OP INSISTS on using permute here, then this is an option:
permute(reshape(A,size(A,1),12,4),[1 2 3])
:)

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by