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

 Akzeptierte Antwort

James Tursa
James Tursa am 17 Apr. 2015
Bearbeitet: James Tursa am 17 Apr. 2015

0 Stimmen

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)

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by