Writing a quadratic equation program to satisfy a solution. I am very confused help please.
Ältere Kommentare anzeigen
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.
Antworten (1)
Walter Roberson
am 15 Apr. 2012
if vw = c/a;
is not a valid statement. The comparison operator is == rather than =
6 Kommentare
Reelz
am 16 Apr. 2012
Walter Roberson
am 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
am 16 Apr. 2012
Walter Roberson
am 16 Apr. 2012
rqe2(5,9,15)
would run it with a=5,b=9,c=15
Reelz
am 17 Apr. 2012
Walter Roberson
am 17 Apr. 2012
Please show your current code.
Kategorien
Mehr zu Quadratic Programming and Cone Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!