Cody

Problem 43185. How to permute given 3d matrix?

Solution 2132335

Submitted on 18 Feb 2020
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

Unrecognized function or variable 'A'. Error in mypermute (line 5) y = permute(A,[2 1 3]) 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

Unrecognized function or variable 'A'. Error in mypermute (line 5) y = permute(A,[2 1 3]) Error in Test2 (line 5) assert(isequal(mypermute(A),y_correct))

Suggested Problems

More from this Author27

Community Treasure Hunt

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

Start Hunting!