Writing a quadratic equation program to satisfy a solution. I am very confused help please.
Mostra commenti meno recenti
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.
Risposte (1)
Walter Roberson
il 15 Apr 2012
if vw = c/a;
is not a valid statement. The comparison operator is == rather than =
6 Commenti
Reelz
il 16 Apr 2012
Walter Roberson
il 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
il 16 Apr 2012
Walter Roberson
il 16 Apr 2012
rqe2(5,9,15)
would run it with a=5,b=9,c=15
Reelz
il 17 Apr 2012
Walter Roberson
il 17 Apr 2012
Please show your current code.
Categorie
Scopri di più su Quadratic Programming and Cone Programming in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!