Cody

# Problem 42671. unique with nan

Solution 767165

Submitted on 26 Oct 2015
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
%% x = [2 NaN 3 5 NaN; 1 NaN 4 9 NaN; 8 -2 7 6 -2; 7 4 8 5 4];; y_correct = [2 NaN 3 5; 1 NaN 4 9; 8 -2 7 6; 7 4 8 5]; assert(isequalwithequalnans(unique_with_nan(x),y_correct))

2   Pass
%% x = [1 0 0 1;NaN 1 0 NaN;NaN 0 1 NaN;0 0 0 0]; y_correct = [1 0 0;NaN 1 0;NaN 0 1;0 0 0]; assert(isequalwithequalnans(unique_with_nan(x),y_correct))

3   Pass
%% x = [1 0 1 1 1 1 0;0 1 1 1 1 1 0;0 0 NaN NaN NaN NaN 0;0 0 NaN NaN NaN NaN 0;0 0 NaN NaN NaN NaN 0;0 0 0 0 0 0 0;0 0 0 0 0 0 1]; y_correct = [1 0 1 0;0 1 1 0;0 0 NaN 0;0 0 NaN 0;0 0 NaN 0;0 0 0 0;0 0 0 1]; assert(isequalwithequalnans(unique_with_nan(x),y_correct))

4   Fail
%% x = [2 NaN 3 5 NaN; 1 NaN 4 9 NaN; 8 pi 7 6 pi; 7 eps 8 5 eps]; y_correct = [2 NaN 3 5; 1 NaN 4 9; 8 pi 7 6; 7 eps 8 5]; assert(isequalwithequalnans(unique_with_nan(x),y_correct))

Assertion failed.