Cody

Solution 1700553

Submitted on 30 Dec 2018 by Nikolaos Nikolaou
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
assert(isequal(ecount(1:10,2),1))

p = 2 ct = 1

2   Pass
assert(isequal(ecount([1 1 1 1 1 1 1 1],1),8))

p = 1 2 3 4 5 6 7 8 ct = 8

3   Pass
assert(isequal(ecount([1 1 1 1 1 1 1 1],2),0))

p = 1×0 empty double row vector ct = 0

4   Pass
assert(isequal(ecount([1 1 1 1 NaN NaN 1 1],NaN),2))

p = 1×8 logical array 0 0 0 0 1 1 0 0 ct = 2

5   Pass
assert(isequal(ecount([1 1 1 1 NaN NaN 1 1],17),0))

p = 1×0 empty double row vector ct = 0

6   Pass
assert(isequal(ecount([15 13 6 2 71 -5 -7 15],15),2))

p = 1 8 ct = 2

Suggested Problems

More from this Author56