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?
조회 수: 6 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (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]
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!