how to define a variable as a function of another variable in symbolic toolbox

조회 수: 4 (최근 30일)
Amit Kumar
Amit Kumar 2014년 10월 5일
댓글: Amit Kumar 2014년 10월 6일
Hi I am just wondering whether is it possible to do following: define a variable as a function of x
u=f(x)
Then,
d/dx (u*x) = u'x + xu'
u' is first derivative of u w.r.t. x.
Is this possible to do using matlab symbolic toolbox?

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 10월 5일
syms x u
u=cos(x)
y=u*x
out=diff(y,x)
  댓글 수: 3
Star Strider
Star Strider 2014년 10월 6일
You need to set it up correctly:
syms f(x) u(x)
ddx = diff(u*f,x)
>
ddx(x) =
D(f)(x)*u(x) + f(x)*D(u)(x)

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by