1.5

1.5 | 2 ratings Rate this file 91 downloads (last 30 days) File Size: 9.42 KB File ID: #22935

Quadratic Equation Calculator

by Diego Orlando Barragan Guerrero

 

09 Feb 2009 (Updated 10 Feb 2009)

Code covered by BSD License  

Quadratic Equation Calculator

Download Now | Watch this File

File Information
Description

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

MATLAB release MATLAB 7.7 (R2008b)
Zip File Content  
Other Files quadratic/quadratic.fig,
quadratic/quadratic.m,
quadratic/readme_leeme(esp).txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
09 Feb 2009 Husam Aldahiyat

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

10 Feb 2009 Matt Fig

In the lines where you calculate the quadratic formula, you need a parenthesis around the 2*a, like this;
x1=(-b+sqrt(b^2-4*a*c))/(2*a)
x2=(-b-sqrt(b^2-4*a*c))/(2*a)
Otherwise your solutions are only valid for a = 1.

10 Feb 2009 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.

10 Feb 2009 Diego Orlando Barragan Guerrero

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

Regards, Diego.

10 Feb 2009 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.

11 Feb 2009 Guillermo Quintas  
Please login to add a comment or rating.
Updates
10 Feb 2009

update

Tag Activity for this File
Tag Applied By Date/Time
calculator Cristina McIntire 09 Feb 2009 15:49:02
mathematics Diego Orlando Barragan Guerrero 09 Feb 2009 15:49:14
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com