Cody

Solution 155348

Submitted on 29 Oct 2012
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, log in.

Test Suite

Test Status Code Input and Output
1   Pass
%% assert(isequal(ecount(1:10,2),1))

isnan = 100 100 100 100 100 100 100 100 100 100 ans = 1

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

isnan = 100 ans = 8

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

isnan = 100 100 ans = 0

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

Error: Subscript indices must either be real positive integers or logicals.

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

Error: Subscript indices must either be real positive integers or logicals.