Cody

Solution 250007

Submitted on 28 May 2013 by Abhijeet Thakur
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
%% x = 1:7; y_correct = 0; assert(isequal(your_fcn_name(x),y_correct))

y = 1 a = 1 a = 2 a = 3 a = 4 a = 5 a = 6

2   Pass
%% x = [7 6 3]; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct))

y = 1 a = 7 a = 6

3   Pass
%% x = [-1 6 3]; y_correct = 0; assert(isequal(your_fcn_name(x),y_correct))

y = 1 a = -1 a = 6

4   Pass
%% x = 20:-2:-4; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct))

y = 1 a = 20 a = 18 a = 16 a = 14 a = 12 a = 10 a = 8 a = 6 a = 4 a = 2 a = 0 a = -2