Cody

Solution 337188

Submitted on 22 Oct 2013 by Alfonso Nieto-Castanon
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,-6,11,-6]; y_correct = [1,2,3]; assert(isequal(round(cubicFormula(x)*10000),y_correct*10000))
2   Pass
%% 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))
3   Pass
%% 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))
4   Pass
%% 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))
5   Pass
%% 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))
6   Pass
%% 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))
7   Pass
%% 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))