a problem about symbolic function diff
조회 수: 1 (최근 30일)
이전 댓글 표시
syms x(t) y(t); f=x*y; I want get df/dx, how to use command diff? Thank you!
댓글 수: 0
답변 (2개)
Star Strider
2014년 6월 16일
You do not get df/dx once you have defined x as x(t). You get the Chain Rule:
dfdx = diff(f)
produces:
dfdx(t) =
D(x)(t)*y(t) + x(t)*D(y)(t)
The command diff(f,x) or diff(f, x(t)) throws an error.
댓글 수: 0
Lucas Carvalho
2017년 5월 13일
편집: Lucas Carvalho
2017년 5월 13일
In your case, the independent variable is only t, while x and y are dependent of t. To derive the f function partially in terms of x or y, you will need the fulldiff function:
https://www.mathworks.com/matlabcentral/fileexchange/7174-fulldiff-m
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!