Problem 1026. Solving a quadratic equation
Given a, b and c, Return the solution of the following quadratic equation: a*x^2 + b*x + c = 0.
Solution Stats
Problem Comments
-
5 Comments
Might want to adjust your assertions there...the _order_ of the solutions should not matter of course, and in case there is a single root, an output of either 1 or 2 equal numbers should be permissible
It's a pity that isequal returns false if the difference between the two arguments is only eps (2e-15).
Why should the solution be giben in a certain way?? in this case the solution [-1 3] must be equal to [3 -1] ... :-/
I will edit the problem. And give more explanations.
Bad test suit.
Solution Comments
Show commentsProblem Recent Solvers93
Suggested Problems
-
Solve the set of simultaneous linear equations
416 Solvers
-
Check if number exists in vector
11159 Solvers
-
Generate N equally spaced intervals between -L and L
857 Solvers
-
Create an index-powered vector
732 Solvers
-
Convert a Cell Array into an Array
1663 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!