File Exchange

image thumbnail

Quadratic Equation Calculator

version (8.26 KB) by Diego Barragán
Quadratic Equation Calculator


Updated 10 Feb 2009

View Version History

View License

Enter the coefficients for the Ax2 + Bx + C = 0 equation and Quadratic Equation will output the solutions and plot(if they are not imaginary).

Cite As

Diego Barragán (2021). Quadratic Equation Calculator (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Guillermo Quintas

Husam Aldahiyat

While you do that why not add more features, like roots of a function regardless of its order or something else. You can use the MATLAB function roots which will help immensly.

Currently, even if you fix these mistakes, it's still very bare bones and needs more features.

Diego Barragán

Hi Husam and Matt Fig, thanks a lot for review my program "Quadratic Equation Calculator". I will change it.

Regards, Diego.

Matt Fig

I gave two stars because by running this program, the root is changed then not changed back. That is not a good way to make users of your code happy. When the user closes the GUI, you need to set colordef back to what it was prior to initialization. I will change my rating when this is fixed.

Matt Fig

In the lines where you calculate the quadratic formula, you need a parenthesis around the 2*a, like this;
Otherwise your solutions are only valid for a = 1.

Husam Aldahiyat

Enter [3 5 2] as values for [A B C] and you'll get messed up results. Same for [2 5 2].

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!