I want to take an Equation as input like ax^2+bx+c =0 , Now I want to take the co-efficient. What will be the code?
Ältere Kommentare anzeigen
I want to take an Equation as input like ax^2+bx+c =0 , Now I want to take the co-efficient. What will be the code?
Antworten (1)
Karan Gill
am 20 Jun. 2016
Bearbeitet: Karan Gill
am 17 Okt. 2017
>> syms a b c x
poly = a*x^2 + b*x + c;
C = coeffs(poly, x)
C =
[ c, b, a]
You might prefer flipping the order of C to match the order of f.
>> fliplr(C)
ans =
[ a, b, c]
1 Kommentar
Sourin Dey
am 24 Jun. 2016
Bearbeitet: Sourin Dey
am 24 Jun. 2016
Kategorien
Mehr zu Numerical Integration and Differential Equations 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!