Cody

# Problem 1923. Find the maximum two numbers of every column of a matrix

Solution 1919236

Submitted on 2 Sep 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 4; 6 0 3; 4 1 5]; y_correct = [6 2 5; 4 1 4]; assert(isequal(your_fcn_name(x),y_correct))

s1 = 6 t = 1 NaN 4 s2 = 4 c = 6 4 s1 = 2 t = NaN 0 1 s2 = 1 c = 6 2 4 1 s1 = 5 t = 4 3 NaN s2 = 4 c = 6 2 5 4 1 4

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test1 (line 6) assert(isequal(your_fcn_name(x),y_correct))

2   Fail
x = ones(3); y_correct = ones(2,3); assert(isequal(your_fcn_name(x),y_correct))

s1 = 1 t = NaN NaN NaN s2 = NaN c = 1 NaN s1 = 1 t = NaN NaN NaN s2 = NaN c = 1 1 NaN NaN s1 = 1 t = NaN NaN NaN s2 = NaN c = 1 1 1 NaN NaN NaN

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test2 (line 3) assert(isequal(your_fcn_name(x),y_correct))

3   Fail
x = eye(4); y_correct = [ones(1,4); zeros(1,4)]; assert(isequal(your_fcn_name(x),y_correct))

s1 = 1 t = NaN 0 0 0 s2 = 0 c = 1 0 s1 = 1 t = 0 NaN 0 0 s2 = 0 c = 1 1 0 0 s1 = 1 t = 0 0 NaN 0 s2 = 0 c = 1 1 1 0 0 0 s1 = 1 t = 0 0 0 NaN s2 = 0 c = 1 1 1 1 0 0 0 0

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test3 (line 3) assert(isequal(your_fcn_name(x),y_correct))

4   Fail
x = [1:5; 6:10; 11:15; 16:20; 21:25]; y_correct = [21:25; 16:20]; assert(isequal(your_fcn_name(x),y_correct))

s1 = 21 t = 1 6 11 16 NaN s2 = 16 c = 21 16 s1 = 22 t = 2 7 12 17 NaN s2 = 17 c = 21 22 16 17 s1 = 23 t = 3 8 13 18 NaN s2 = 18 c = 21 22 23 16 17 18 s1 = 24 t = 4 9 14 19 NaN s2 = 19 c = 21 22 23 24 16 17 18 19 s1 = 25 t = 5 10 15 20 NaN s2 = 20 c = 21 22 23 24 25 16 17 18 19 20

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test4 (line 7) assert(isequal(your_fcn_name(x),y_correct))

5   Fail
x = [1 5 7 3 47 2 3; 6 7 1 5 23 1 47; 7 1 3 2 68 4 11]; y_correct = [7 7 7 5 68 4 47; 6 5 3 3 47 2 11]; assert(isequal(your_fcn_name(x),y_correct))

s1 = 7 t = 1 6 NaN s2 = 6 c = 7 6 s1 = 7 t = 5 NaN 1 s2 = 5 c = 7 7 6 5 s1 = 7 t = NaN 1 3 s2 = 3 c = 7 7 7 6 5 3 s1 = 5 t = 3 NaN 2 s2 = 3 c = 7 7 7 5 6 5 3 3 s1 = 68 t = 47 23 NaN s2 = 47 c = 7 7 7 5 68 6 5 3 3 47 s1 = 4 t = 2 1 NaN s2 = 2 c = 7 7 7 5 68 4 6 5 3 3 47 2 s1 = 47 t = 3 NaN 11 s2 = 11 c = 7 7 7 5 68 4 47 6 5 3 3 47 2 11

Output argument "y" (and maybe others) not assigned during call to "your_fcn_name". Error in Test5 (line 6) assert(isequal(your_fcn_name(x),y_correct))