Cody

# Problem 43625. Calculate roots of polynomial given as vector array.

Solution 1584504

Submitted on 16 Jul 2018
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 2 0 5 0 3]; y_correct = [-2.7267 + 0.0000i ;0.4784 + 1.0983i ;0.4784 - 1.0983i ;-0.1150 + 0.8680i ;-0.1150 - 0.8680i]; y=PolRoot(x) assert(abs(y(1)-y_correct(1))<10^(-4)) assert(abs(y(2)-y_correct(2))<10^(-4)) assert(abs(y(3)-y_correct(3))<10^(-4)) assert(abs(y(4)-y_correct(4))<10^(-4))

Undefined function 'root' for input arguments of type 'double'. Error in PolRoot (line 2) root(x) Error in Test1 (line 3) y=PolRoot(x)

2   Fail
x = [3 2 5 1 0 2]; y_correct = [-0.3205 + 1.2968i; -0.3205 - 1.2968i; -0.7915 + 0.0000i; 0.3829 + 0.5704i; 0.3829 - 0.5704i]; y=PolRoot(x) assert(abs(y(1)-y_correct(1))<10^(-4)) assert(abs(y(2)-y_correct(2))<10^(-4)) assert(abs(y(3)-y_correct(3))<10^(-4)) assert(abs(y(4)-y_correct(4))<10^(-4))

Undefined function 'root' for input arguments of type 'double'. Error in PolRoot (line 2) root(x) Error in Test2 (line 3) y=PolRoot(x)