Cody

Solution 1790348

Submitted on 16 Apr 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
tm=[]; for t=1:100 rng('default'); m=rand(100,100,100); m(m>0.7)=nan; tic o=removenan(m); tm(t)=toc; end rng('default'); m=rand(100,100,100); m(m>0.7)=nan; m(isnan(m))=[]; t_correct=0.019; assert(mean(tm)<t_correct) assert(isequal(o,m'))

Error using removenan Too many input arguments. Error in removenan (line 3) nanless= removenan(m,loc); Error in Test1 (line 7) o=removenan(m);

2   Fail
tm=[]; for t=1:100 rng('default'); m=rand(100,10000); m(m>0.71)=nan; tic o=removenan(m); tm(t)=toc; end rng('default'); m=rand(100,10000); m(m>0.71)=nan; m(isnan(m))=[]; t_correct=0.019; assert(mean(tm)<t_correct) assert(isequal(o,m'))

Error using removenan Too many input arguments. Error in removenan (line 3) nanless= removenan(m,loc); Error in Test2 (line 7) o=removenan(m);

3   Fail
tm=[]; for t=1:100 rng('default'); m=rand(2,500000); m(m>0.69)=nan; tic o=removenan(m); tm(t)=toc; end rng('default'); m=rand(2,500000); m(m>0.69)=nan; m(isnan(m))=[]; t_correct=0.019; assert(mean(tm)<t_correct) assert(isequal(o,m'))

Error using removenan Too many input arguments. Error in removenan (line 3) nanless= removenan(m,loc); Error in Test3 (line 7) o=removenan(m);