Cody

Solution 1206001

Submitted on 6 Jun 2017 by Md.Farhad Hassan
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))

r = 3 c = 3 k = 0 j = 1 j = 2 j = 3 p = 1 f = 1 f = 1 5 f = 1 5 8 k = 0 j = 1 j = 2 k = 1 j = 3 k = 0 j = 1 j = 2 j = 3 k = 1 B = 1 5 8

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

r = 1 c = 10 k = 0 j = 1 j = 2 j = 3 j = 4 j = 5 j = 6 j = 7 j = 8 j = 9 j = 10 p = 1 f = 1 f = 1 2 f = 1 2 3 f = 1 2 3 4 f = 1 2 3 4 5 f = 1 2 3 4 5 6 f = 1 2 3 4 5 6 7 f = 1 2 3 4 5 6 7 8 f = 1 2 3 4 5 6 7 8 9 f = 1 2 3 4 5 6 7 8 9 10 B = 1 2 3 4 5 6 7 8 9 10

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))

r = 3 c = 3 k = 0 j = 1 j = 2 j = 3 p = 1 f = 1 f = 1 5 f = 1 5 8 k = 0 j = 1 j = 2 k = 1 j = 3 k = 0 j = 1 j = 2 j = 3 p = 2 f = 1 5 8 0 0 0 f = 1 5 8 0 6 0 f = 1 5 8 0 6 6 B = 1 5 8 0 6 6

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

r = 6 c = 1 k = 0 j = 1 p = 1 f = 1 k = 0 j = 1 p = 2 f = 1 3 k = 0 j = 1 p = 3 f = 1 3 6 k = 0 j = 1 k = 1 k = 0 j = 1 p = 4 f = 1 3 6 3 k = 0 j = 1 k = 1 B = 1 3 6 3

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))

r = 2 c = 4 k = 0 j = 1 j = 2 j = 3 j = 4 k = 1 k = 0 j = 1 j = 2 j = 3 j = 4 p = 1 f = 3 f = 3 4 f = 3 4 2 f = 3 4 2 1 B = 3 4 2 1

Suggested Problems