Cody

# Problem 43185. How to permute given 3d matrix?

Solution 1642806

Submitted on 11 Oct 2018
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
A(:,:,1)=[1 3] A(:,:,2)=[2 2] A(:,:,3)=[4 3] y_correct = permute(A,[2 1 3]); assert(isequal(mypermute(A),y_correct))

A = 1 3 A(:,:,1) = 1 3 A(:,:,2) = 2 2 A(:,:,1) = 1 3 A(:,:,2) = 2 2 A(:,:,3) = 4 3

Error using ' Transpose on ND array is not defined. Use PERMUTE instead. Error in mypermute (line 5) y = (x'); Error in Test1 (line 5) assert(isequal(mypermute(A),y_correct))

2   Fail
A(:,:,1)=[2;3] A(:,:,2)=[3;2] A(:,:,3)=[4;3] y_correct = permute(A,[2 1 3]); assert(isequal(mypermute(A),y_correct))

A = 2 3 A(:,:,1) = 2 3 A(:,:,2) = 3 2 A(:,:,1) = 2 3 A(:,:,2) = 3 2 A(:,:,3) = 4 3

Error using ' Transpose on ND array is not defined. Use PERMUTE instead. Error in mypermute (line 5) y = (x'); Error in Test2 (line 5) assert(isequal(mypermute(A),y_correct))