Writing a quadratic equation program to satisfy a solution. I am very confused help please.
Show older comments
I am trying to write a program in which two solutions, v and w, of the quadratic equation q(x) = ax^2 + bx +c = 0, that satisfies vw = c/a. I want this program to numerically solve such equations given a, b and c. The larger (abs solution) v using this quadratic formula, and the smaller w using w = c/(av), and of course having a provision for a = 0. I want my output to be a vector of solutions showing how many solutions exist. This relatively simple exercise is killing me because I cannot figure it out. Help greatly appreciated with explanation.
Answers (1)
Walter Roberson
on 15 Apr 2012
if vw = c/a;
is not a valid statement. The comparison operator is == rather than =
6 Comments
Reelz
on 16 Apr 2012
Walter Roberson
on 16 Apr 2012
Which error are you getting now?
How you added to your code so that vw is assigned before you attempt to use it?
Reelz
on 16 Apr 2012
Walter Roberson
on 16 Apr 2012
rqe2(5,9,15)
would run it with a=5,b=9,c=15
Reelz
on 17 Apr 2012
Walter Roberson
on 17 Apr 2012
Please show your current code.
Categories
Find more on Systems of Nonlinear Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!