Cody

Problem 43185. How to permute given 3d matrix?

Solution 2132336

Submitted on 18 Feb 2020 by Jiahang Li
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   Pass
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 y(:,:,1) = 1 3 y(:,:,2) = 2 2 y(:,:,3) = 4 3

2   Pass
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 y(:,:,1) = 2 3 y(:,:,2) = 3 2 y(:,:,3) = 4 3

Suggested Problems

More from this Author27