Matlab - Transpose a 3D matrix only in the third dimension

前端 未结 1 550
日久生厌
日久生厌 2021-01-12 08:19

I have a 3 x 3 x 2 matrix, for example :

M(:,:,1) =
     1     2     3
     4     5     6
     7     8     9

M(:,:,2) =
    10    11    12
    13    14    1         


        
相关标签:
1条回答
  • 2021-01-12 08:55

    That's what permute does:

    result = permute(M, [2 1 3]); %// swap dimensions 1 and 2
    
    0 讨论(0)
提交回复
热议问题