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?
Mostrar comentarios más antiguos
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?
Respuestas (1)
Karan Gill
el 20 de Jun. de 2016
Editada: Karan Gill
el 17 de Oct. de 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 comentario
Sourin Dey
el 24 de Jun. de 2016
Editada: Sourin Dey
el 24 de Jun. de 2016
Categorías
Más información sobre Numerical Integration and Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!