Cody

Solution 502777

Submitted on 18 Sep 2014 by Jan Orwat
  • Size: 23
  • This is the leading solution.
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
%% A = [1 4 7 10 2 8]; range = 1; inrange = [1 0 1 0 1 1]; assert(isequal(isinrange(A, range),inrange))

2   Pass
%% A = [10 15 18 12 3 7 2]; range = 2; inrange = [1 0 0 1 1 0 1]; assert(isequal(isinrange(A, range),inrange))

3   Pass
%% A = [10 15 18 12 4 7 2]; range = 3; inrange = [1 1 1 1 1 1 1]; assert(isequal(isinrange(A, range),inrange))

4   Pass
%% A = [10 15 18 12 4 7 2]; range = 1; inrange = [0 0 0 0 0 0 0]; assert(isequal(isinrange(A, range),inrange))

Suggested Problems

More from this Author9