필터 지우기
필터 지우기

How to calculate the coefficients of non-polynomial terms

조회 수: 3 (최근 30일)
T S Singh
T S Singh 2018년 9월 8일
편집: madhan ravi 2018년 9월 8일
I am trying to find the coefficients of non-polynomial terms
For example
syms x
a=-9*cos(x)*4+x*9+4*sin(x)
I want to find the coefficients of sin(x) and cos(x).
When using coeffs its not working
Thanks

채택된 답변

madhan ravi
madhan ravi 2018년 9월 8일
편집: madhan ravi 2018년 9월 8일
syms x
a=-9*cos(x)*4+x*9+4*sin(x)
[C,T] = coeffs(a) %edited after John’s comment.
It’s working for me
  댓글 수: 11
T S Singh
T S Singh 2018년 9월 8일
Yes, Actually I have included a new symbol y in the expression
syms x y
a=-9*y*cos(x)*4+x*9+4*sin(x);
[C,T] = coeffs(a,{sin(x),cos(x),x})
C =
[ 4, -36*y, 9]
T =
[ sin(x), cos(x), x]
Thanks John
madhan ravi
madhan ravi 2018년 9월 8일
편집: madhan ravi 2018년 9월 8일
if you find it useful please accept the answer, thank you @John

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by