Cody

Solution 505635

Submitted on 26 Sep 2014 by James
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))

t = 2 3 6 9 1 7 t = 3 2 3 6 2 4 t = 6 3 2 3 5 1 t = 9 6 3 2 8 2 t = 1 2 5 8 2 6 t = 7 4 1 2 6 2

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))

t = 3 5 8 2 7 3 8 t = 5 3 3 3 12 8 13 t = 8 3 3 6 15 11 16 t = 2 3 6 3 9 5 10 t = 7 12 15 9 3 4 1 t = 3 8 11 5 4 3 5 t = 8 13 16 10 1 5 3

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))

t = 4 5 8 2 6 3 8 t = 5 4 3 3 11 8 13 t = 8 3 4 6 14 11 16 t = 2 3 6 4 8 5 10 t = 6 11 14 8 4 3 2 t = 3 8 11 5 3 4 5 t = 8 13 16 10 2 5 4

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))

t = 2 5 8 2 6 3 8 t = 5 2 3 3 11 8 13 t = 8 3 2 6 14 11 16 t = 2 3 6 2 8 5 10 t = 6 11 14 8 2 3 2 t = 3 8 11 5 3 2 5 t = 8 13 16 10 2 5 2