Cody

# Problem 43079. Check if two matrices are permutations of each other

Solution 1738186

Submitted on 27 Feb 2019
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
x = [1 2 3; 4 5 6; 7 8 9] y = [3 5 6; 7 1 2; 4 9 8] isPerm = true; assert(isequal(isPermute(x,y),isPerm))

x = 1 2 3 4 5 6 7 8 9 y = 3 5 6 7 1 2 4 9 8 a = 9 b = 9 isperm = logical 1

Output argument "isPerm" (and maybe others) not assigned during call to "isPermute". Error in Test1 (line 4) assert(isequal(isPermute(x,y),isPerm))

2   Fail
x = [1 2; 4 5; 7 8]; y = x'; isPerm = true; assert(isequal(isPermute(x,y),isPerm))

a = 6 b = 6 isperm = logical 1

Output argument "isPerm" (and maybe others) not assigned during call to "isPermute". Error in Test2 (line 4) assert(isequal(isPermute(x,y),isPerm))

3   Fail
x = 1:50; y = randperm(50); isPerm = true; assert(isequal(isPermute(x,y),isPerm))

a = 50 b = 50 isperm = logical 1

Output argument "isPerm" (and maybe others) not assigned during call to "isPermute". Error in Test3 (line 4) assert(isequal(isPermute(x,y),isPerm))

4   Fail
x = 2:51; y = randperm(50); isPerm = false; assert(isequal(isPermute(x,y),isPerm))

a = 50 b = 50 isperm = logical 1

Output argument "isPerm" (and maybe others) not assigned during call to "isPermute". Error in Test4 (line 4) assert(isequal(isPermute(x,y),isPerm))

5   Fail
x = [1 2 3; 4 5 6; 7 8 9] y = [3 5; 7 1; 4 9] isPerm = false; assert(isequal(isPermute(x,y),isPerm))

x = 1 2 3 4 5 6 7 8 9 y = 3 5 7 1 4 9 a = 9 b = 6 isperm = logical 0

Output argument "isPerm" (and maybe others) not assigned during call to "isPermute". Error in Test5 (line 4) assert(isequal(isPermute(x,y),isPerm))