Cody

Solution 2170174

Submitted on 22 Mar 2020 by Asif Newaz
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
m = [3 1 5 0 0 3 4 1 5 0 4 2 1 5 0]; srows = [3 1 5 0 0;4 2 1 5 0]; assert(isequal(findsimilar(m),srows))

c1 = 1×4 logical array 1 0 1 1 c2 = 1×3 logical array 1 1 1 d1 = 1 3 4 d2 = 1 2 3 e1 = 2 1 e2 = 1 1 c1 = 1×4 logical array 0 0 1 1 c2 = 1×3 logical array 0 1 1 d1 = 3 4 d2 = 2 3 e1 = 1 e2 = 1

2   Pass
m = [3 1 5 0 0 1 2 5 0 0 1 3 4 1 5 2 1 5 0 0]; srows = [3 1 5 0 0; 2 1 5 0 0]; assert(isequal(findsimilar(m),srows))

c1 = 1×3 logical array 1 0 1 c2 = 1×3 logical array 0 1 1 d1 = 1 3 d2 = 2 3 e1 = 2 e2 = 1 c1 = 1×5 logical array 1 1 0 1 1 c2 = 1×3 logical array 1 1 1 d1 = 1 2 4 5 d2 = 1 2 3 e1 = 1 2 1 e2 = 1 1 c1 = 1×3 logical array 0 1 1 c2 = 1×3 logical array 0 1 1 d1 = 2 3 d2 = 2 3 e1 = 1 e2 = 1

3   Pass
m = [3 1 5 7 0 3 2 5 7 0 3 5 7 2 0 1 5 7 2 0 4 6 7 8 9 4 5 7 8 0 4 5 6 7 8]; srows = [3 1 5 7 0;1 5 7 2 0;4 6 7 8 9;4 5 7 8 0]; assert(isequal(findsimilar(m),srows))

c1 = 1×4 logical array 1 0 1 1 c2 = 1×4 logical array 1 0 1 1 d1 = 1 3 4 d2 = 1 3 4 e1 = 2 1 e2 = 2 1 c1 = 1×4 logical array 1 1 1 0 c2 = 1×4 logical array 1 0 1 1 d1 = 1 2 3 d2 = 1 3 4 e1 = 1 1 e2 = 2 1 c1 = 1×4 logical array 1 1 1 0 c2 = 1×4 logical array 0 1 1 1 d1 = 1 2 3 d2 = 2 3 4 e1 = 1 1 e2 = 1 1 c1 = 1×5 logical array 0 0 1 0 0 c2 = 1×4 logical array 0 0 0 1 d1 = 3 d2 = 4 e1 = [] e2 = [] c1 = 1×4 logical array 0 1 1 0 c2 = 1×4 logical array 0 0 1 1 d1 = 2 3 d2 = 3 4 e1 = 1 e2 = 1 c1 = 1×5 logical array 0 1 0 1 0 c2 = 1×4 logical array 0 0 1 1 d1 = 2 4 d2 = 3 4 e1 = 2 e2 = 1

4   Pass
m = [3 1 5 0 0 3 1 6 0 0 3 2 6 0 0 2 1 5 6 0]; srows = m; assert(isequal(findsimilar(m), srows))

c1 = 1×3 logical array 1 1 0 c2 = 1×3 logical array 1 1 0 d1 = 1 2 d2 = 1 2 e1 = 1 e2 = 1 c1 = 1×3 logical array 1 0 0 c2 = 1×3 logical array 1 0 0 d1 = 1 d2 = 1 e1 = [] e2 = [] c1 = 1×4 logical array 0 1 1 0 c2 = 1×3 logical array 0 1 1 d1 = 2 3 d2 = 2 3 e1 = 1 e2 = 1

Suggested Problems

More from this Author9