Is there a way to input a function as "g=@(x) exp(x^2-2);" and take the derivative?

 採用された回答

James Tursa
James Tursa 2015 年 4 月 17 日
編集済み: James Tursa 2015 年 4 月 17 日

0 投票

If you have the Symbolic Toolbox:
>> g = @(x) exp(x^2-2)
g =
@(x)exp(x^2-2)
>> syms x
>> diff(g(x))
ans =
2*x*exp(x^2 - 2)

その他の回答 (0 件)

カテゴリ

質問済み:

2015 年 4 月 17 日

編集済み:

2015 年 4 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by