Cody

Solution 884844

Submitted on 2 May 2016
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:8; y_correct = 1; assert(isequal(stype(x),y_correct))

2   Pass
x = 2.^(1:8); y_correct = 2; assert(isequal(stype(x),y_correct))

y = 2

3   Pass
x = [1 1 2 3 5 8 13 21 34]; y_correct = 0; assert(isequal(stype(x),y_correct))

4   Pass
x = ones(1,80); y_correct1 = 1; y_correct2 = 2; assert(isequal(stype(x),y_correct1)|isequal(stype(x),y_correct2))

5   Pass
x = [ones(1,40) 0 ones(1,40)]; y_correct = 0; assert(isequal(stype(x),y_correct))

6   Pass
x = [exp(1) exp(3) exp(5) exp(7) exp(9)]; y_correct = 2; assert(isequal(stype(x),y_correct))

y = 2

7   Pass
x = [-64 32 -16 8 -4 2 -1 0.5 -0.25]; y_correct = 2; assert(isequal(stype(x),y_correct))

y = 2

8   Pass
x = [-9.6 -9.7 -9.8 -9.9 -10 -10.1 -10.2 -10.3 -10.4]; y_correct = 1; assert(isequal(stype(x),y_correct))

9   Pass
x = [1 1 -1 -1]; y_correct = 0; assert(isequal(stype(x),y_correct))

10   Pass
x = [i 3i 5i 7i]; y_correct = 1; assert(isequal(stype(x),y_correct))

11   Fail
x = [i -2 -4i 8 16i]; y_correct = 2; assert(isequal(stype(x),y_correct))

Assertion failed.