Cody

Solution 1763230

Submitted on 27 Mar 2019 by Abdelfatah Teamah
  • Size: 7
  • 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
x = [4 -5 -2 9]; y_correct = [9 2 -5 -4]; assert(isequal(your_fcn_name(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint1 (line 3) In solutionTest (line 3)]

2   Pass
x = ones(1,4); y_correct = [1 -1 1 -1]; assert(isequal(your_fcn_name(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint2 (line 3) In solutionTest (line 5)]

3   Pass
x = 1:10; y_correct = [10 -9 8 -7 6 -5 4 -3 2 -1]; assert(isequal(your_fcn_name(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint3 (line 3) In solutionTest (line 7)]

4   Pass
x = 2:2:12; y_correct = [12 -10 8 -6 4 -2]; assert(isequal(your_fcn_name(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 9)]

5   Pass
x = -3:3; y_correct = [3 -2 1 0 -1 2 -3]; assert(isequal(your_fcn_name(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 11)]

6   Pass
x = [1 1 2 3 5 8 13 21 34 55 89 144]; y_correct = [144 -89 55 -34 21 -13 8 -5 3 -2 1 -1]; assert(isequal(your_fcn_name(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint6 (line 3) In solutionTest (line 13)]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint7 (line 3) In solutionTest (line 15)]

8   Pass
x = [0 1 0 2 0 3 0 4 0 5 0 6]; y_correct = [6 0 5 0 4 0 3 0 2 0 1 0]; assert(isequal(your_fcn_name(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)]

9   Pass
x = [0 1 0 1 0 1 0 1 0 1 0 1]; y_correct = [x(2:end) x(1)]; assert(isequal(your_fcn_name(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint9 (line 3) In solutionTest (line 19)]

More from this Author9