Cody

# Problem 1954. Write a cubic formula function

Solution 1753035

Submitted on 17 Mar 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 = [1,-6,11,-6]; y_correct = [1,2,3]; assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

Undefined function 'cubicFormula' for input arguments of type 'double'. Error in Test1 (line 3) assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

2   Fail
x = [1,2,3,4]; y_correct = [-0.1747 - 1.5469i, -0.1747 + 1.5469i, -1.6506 + 0.0000i]; assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

Undefined function 'cubicFormula' for input arguments of type 'double'. Error in Test2 (line 3) assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

3   Fail
x = [45,-67,31,96]; y_correct = [-0.8231 + 0.0000i, 1.1560 - 1.1205i, 1.1560 + 1.1205i]; assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

Undefined function 'cubicFormula' for input arguments of type 'double'. Error in Test3 (line 3) assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

4   Fail
x = [2,1,-3,0]; y_correct = [0.0000 - 0.0000i 1.0000 + 0.0000i -1.5000 + 0.0000i]; assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

Undefined function 'cubicFormula' for input arguments of type 'double'. Error in Test4 (line 3) assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

5   Fail
x = [3,-4i,5,7i]; y_correct = [-0.8177 - 0.5435i, 0.8177 - 0.5435i, 0.0000 + 2.4203i]; assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

Undefined function 'cubicFormula' for input arguments of type 'double'. Error in Test5 (line 3) assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

6   Fail
x = [-19,136,3+15i,77]; y_correct = [-0.0411 + 0.6943i, -0.0591 - 0.8005i, 7.2581 + 0.1062i]; assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

Undefined function 'cubicFormula' for input arguments of type 'double'. Error in Test6 (line 3) assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

7   Fail
x = [.25,.76-.98i,-.23+.11i,-.54]; y_correct = [-0.4977 - 0.2736i, 0.6955 + 0.2758i, -3.2378 + 3.9177i]; assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))

Undefined function 'cubicFormula' for input arguments of type 'double'. Error in Test7 (line 3) assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))