Derivative a function according to another function

Hello
This is my code :
t= sym('t');
y(t)=sym('y(t)');
%Then i do some calculation but let's say that
T= 1/2*y(t)^2 %this is not my function but an exemple.
I try to differentiate T according to y. I try diff(T,y) and diff(T,y(t)), both don't work.
Do you have any clue how to do that ?
Thanks

回答 (1 件)

Mischa Kim
Mischa Kim 2015 年 5 月 28 日

0 投票

Alexis, I believe functionalDerivative is what you are looking for:
t = sym('t');
y(t) = sym('y(t)');
T = 1/2*y(t)^2;
functionalDerivative(T,y)
ans(t) =
y(t)

カテゴリ

ヘルプ センター および File ExchangeMathematics and Optimization についてさらに検索

製品

質問済み:

2015 年 5 月 26 日

回答済み:

2015 年 5 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by