필터 지우기
필터 지우기

In a symbolic expression, how can I extract all terms that have a common specific variable?

조회 수: 35 (최근 30일)
Hello,
In a symbolic expression, is there a way to extract all terms that have a common specific variables? For example, if I have the symoblic function
dxdt = f(a,b,c)*x1+f(a,b,c)*x2+f(a,b,c)*x1+f(a,b,c)*x3+...
Is there a way to extract all terms in dxdt that have x1 in them? I'm looking to try to put my expression dxdt in standard state space form. (My symbolic function can be very lengthy, so using the simplify function is not necessarily grouping all the x1 terms together.)
Thank you, Kevin

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 21일
편집: Azzi Abdelmalek 2013년 3월 21일
Use collect function
collect(dxdt,x1)
and coeffs function

추가 답변 (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