Derivative of a Function

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
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 个)

类别

Community Treasure Hunt

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

Start Hunting!

Translated by