Cody

Problem 44698. how many of the entries are positive?

Solution 3872548

Submitted on 27 Nov 2020
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))

Error in solution: Line: 2 Column: 21 Invalid expression. Check for missing or extra characters.

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

Error in solution: Line: 2 Column: 21 Invalid expression. Check for missing or extra characters.

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

Error in solution: Line: 2 Column: 21 Invalid expression. Check for missing or extra characters.

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

Error in solution: Line: 2 Column: 21 Invalid expression. Check for missing or extra characters.

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

Error in solution: Line: 2 Column: 21 Invalid expression. Check for missing or extra characters.

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!