Cody

# Problem 44698. how many of the entries are positive?

Solution 1590620

Submitted on 24 Jul 2018
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
assert(isequal(pos(sin(linspace(0,10*pi,100))),49))

Output argument "count" (and maybe others) not assigned during call to "pos". Error in Test1 (line 1) assert(isequal(pos(sin(linspace(0,10*pi,100))),49))

2   Fail
assert(isequal(pos(sin(linspace(0,2*pi,100))),49))

Output argument "count" (and maybe others) not assigned during call to "pos". Error in Test2 (line 1) assert(isequal(pos(sin(linspace(0,2*pi,100))),49))

3   Fail
assert(isequal(pos(-10:10),10))

Output argument "count" (and maybe others) not assigned during call to "pos". Error in Test3 (line 1) assert(isequal(pos(-10:10),10))

4   Fail
x=NaN(1,10) assert(isequal(pos(x),0))

x = NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

Output argument "count" (and maybe others) not assigned during call to "pos". Error in Test4 (line 2) assert(isequal(pos(x),0))

5   Fail
x=[NaN(1,10) -10:10] assert(isequal(pos(x),10))

x = Columns 1 through 30 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 Column 31 10

Output argument "count" (and maybe others) not assigned during call to "pos". Error in Test5 (line 3) assert(isequal(pos(x),10))