Cody

Solution 1709000

Submitted on 18 Jan 2019
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   Fail
x = rand(2,2,2); y = neg2(neg2(x)); y_correct = -x; assert(isequal(y,y_correct))

Assertion failed.

2   Pass
x = []; y = neg2(neg2(x)); y_correct = -x; assert(isequal(y,y_correct))

3   Fail
x = sqrt(-5); y = neg2(neg2(x)); y_correct = -x; assert(isequal(y,y_correct))

Assertion failed.

4   Pass
x = rand; disp(neg2(x))

-0.6514