Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [1 5 8 9 7 4 5];
y_correct = roots(x);
assert(isequal(return_root(x),y_correct))
x = [1 0 0 48 50];
y_correct = roots(x);
assert(isequal(return_root(x),y_correct))
x = [11 55 4 6 ];
y_correct = roots(x)
assert(isequal(return_root(x),y_correct))
ans =
-3.1806 + 0.0000i
-1.3843 + 0.0000i
-0.5410 + 1.1441i
-0.5410 - 1.1441i
0.3234 + 0.7774i
0.3234 - 0.7774i
ans =
2.1268 + 3.1883i
2.1268 - 3.1883i
-3.1847 + 0.0000i
-1.0689 + 0.0000i
y_correct =
-4.9488 + 0.0000i
-0.0256 + 0.3310i
-0.0256 - 0.3310i
ans =
-4.9488 + 0.0000i
-0.0256 + 0.3310i
-0.0256 - 0.3310i
|
1223 Solvers
Arrange Vector in descending order
4077 Solvers
856 Solvers
282 Solvers
286 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!