Cody

# Problem 42518. Roots of quadratic equation

Solution 2200259

Submitted on 8 Apr 2020
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
a = 1; b = 2; c = 1; y_correct = [-1 -1]; assert(sum(abs(roots(a,b,c)-y_correct))<1e-3)

Error: File: roots.m Line: 2 Column: 8 Invalid syntax for calling function 'varargin' on the path. Use a valid syntax or explicitly initialize 'varargin' to make it a variable. Error in Test1 (line 5) assert(sum(abs(roots(a,b,c)-y_correct))<1e-3)

2   Fail
a = 9; b = 42; c = 5; y_correct = [-4.5444 -0.1223]; assert(sum(abs(roots(a,b,c)-y_correct))<1e-3)

Error: File: roots.m Line: 2 Column: 8 Invalid syntax for calling function 'varargin' on the path. Use a valid syntax or explicitly initialize 'varargin' to make it a variable. Error in Test2 (line 5) assert(sum(abs(roots(a,b,c)-y_correct))<1e-3)

3   Fail
a = 10; b = 42; c = 7; y_correct = [-4.0261 -0.1739]; assert(sum(abs(roots(a,b,c)-y_correct))<1e-3)

Error: File: roots.m Line: 2 Column: 8 Invalid syntax for calling function 'varargin' on the path. Use a valid syntax or explicitly initialize 'varargin' to make it a variable. Error in Test3 (line 5) assert(sum(abs(roots(a,b,c)-y_correct))<1e-3)