Problem 42518. Roots of quadratic equation

Solution 738319

Submitted on 17 Sep 2015 by Peng Liu
  • Size: 0
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Fail
%% a = 1; b = 2; c = 1; y_correct = -1; y_correct = -1; assert(isequal(your_fcn_name(x),y_correct))

[Warning: Function horzcat has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

Undefined function or variable 'x'.

2   Fail
%% a = 9; b = 42; c = 5; y_correct = -0.22005; y_correct = -8.17995; assert(isequal(roots(x),y_correct))

Undefined function or variable 'x'.

Suggested Problems

More from this Author18

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!