Cody

Solution 2098862

Submitted on 19 Jan 2020 by kieran Thompson
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 5 8 -3 NaN 14 0 6 NaN ]; B_correct = [ 1 5 8 ]; assert(isequal(remove_nan_rows(A),B_correct))

x = 3 y = 3 i = 1 j = 1 j = 2 j = 3 j = 4 i = 2 j = 1 j = 2 j = 3 B = 1 5 8 0 6 NaN x = 2 i = 1 j = 4 i = 2 j = 1 j = 2 j = 3 j = 3 B = 1 5 8 x = 1 i = 1 j = 4 i = 2 j = 1

2   Pass
A = 1:10; B_correct = A; assert(isequal(remove_nan_rows(A),B_correct))

x = 1 y = 10 i = 1 j = 1 j = 2 j = 3 j = 4 j = 5 j = 6 j = 7 j = 8 j = 9 j = 10 j = 11 i = 2 j = 1

3   Pass
A = [ 1 5 8 -3 NaN 14 0 6 6]; B_correct = [1 5 8; 0 6 6]; assert(isequal(remove_nan_rows(A),B_correct))

x = 3 y = 3 i = 1 j = 1 j = 2 j = 3 j = 4 i = 2 j = 1 j = 2 j = 3 B = 1 5 8 0 6 6 x = 2 i = 1 j = 4 i = 2 j = 1 j = 2 j = 3 j = 4 i = 3 j = 1

4   Pass
A = [ 1 3 6 NaN 3 NaN]'; B_correct = [1 3 6 3]'; assert(isequal(remove_nan_rows(A),B_correct))

x = 6 y = 1 i = 1 j = 1 j = 2 i = 2 j = 1 j = 2 i = 3 j = 1 j = 2 i = 4 j = 1 j = 1 B = 1 3 6 3 NaN x = 5 i = 3 j = 2 i = 4 j = 1 j = 2 i = 5 j = 1 j = 1 B = 1 3 6 3 x = 4 i = 4 j = 2 i = 5 j = 1

5   Pass
A = [ 1 3 6 NaN; 3 4 2 1]; B_correct = [3 4 2 1]; assert(isequal(remove_nan_rows(A),B_correct))

x = 2 y = 4 i = 1 j = 1 j = 2 j = 3 j = 4 j = 4 B = 3 4 2 1 x = 1 i = 0 j = 5 i = 1 j = 1 j = 2 j = 3 j = 4 j = 5 i = 2 j = 1

Suggested Problems

More from this Author95