Cody

Solution 1618985

Submitted on 29 Aug 2018 by HH
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))

ans = 1

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

ans = 2

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

ans = 0

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

ans = 2 ans = 2

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

ans = 0

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

ans = 2

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

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

ans = 1

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

ans = 0

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

ans = 1

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

ans = 2