i want to find total derivative in MATLAB eq== cos(x) = sin(y)*x the solution should be like this -sin(x) = x*cos(y)*dy/dx + sin(y)

 採用された回答

Adam Barber
Adam Barber 2015 年 10 月 16 日

0 投票

Hey Kanav,
Check out "diff" in the Symbolic Math Toolbox. One thing to note is that for the form you want, you need to explicitly define y as a function of x.
syms x y(x)
diff(cos(x) - sin(y)*x,x)
returns
- sin(y(x)) - sin(x) - x*cos(y(x))*diff(y(x), x)
-Adam

1 件のコメント

Kanav Vij
Kanav Vij 2015 年 10 月 16 日
thanks Adam

サインインしてコメントする。

その他の回答 (1 件)

zeeshan shafiq
zeeshan shafiq 2020 年 2 月 2 日

0 投票

>> syms x y
>> f=inline('sin(x)+2*cos(y)','x',' y')
f =
Inline function:
f(x, y) = sin(x)+2*cos(y)
>> derivative=inline(diff(f(x,y),x,y),'x','y')
derivative =
Inline function:
derivative(x,y) = 0.0
>> derivative(2,5)
ans =
0
>>

カテゴリ

ヘルプ センター および File ExchangeFunction Creation についてさらに検索

タグ

質問済み:

2015 年 10 月 16 日

回答済み:

2020 年 2 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by