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?
古いコメントを表示
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?
回答 (1 件)
Karan Gill
2016 年 6 月 20 日
編集済み: Karan Gill
2017 年 10 月 17 日
>> 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 件のコメント
Sourin Dey
2016 年 6 月 24 日
編集済み: Sourin Dey
2016 年 6 月 24 日
カテゴリ
ヘルプ センター および File Exchange で Numerical Integration and Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!