How can I extract coefficients in terms of variables out of an expression in Matlab?

조회 수: 8 (최근 30일)
I need to return coefficients of variable from an expression or polynomial. Actually, in Maxima I was using ratcoef(exp,var) . I need exactly same work in MATLAB.

채택된 답변

Walter Roberson
Walter Roberson 2018년 7월 25일
If your expression is symbolic, see sym2poly() and see coeffs()
If your expression is not a polynomial then getting the coefficients can be more difficult. For example neither sym2poly() nor coeffs() can extract the pi/7 of sin(pi/7*x)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by