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

 Respuesta aceptada

James Tursa
James Tursa el 17 de Abr. de 2015
Editada: James Tursa el 17 de Abr. de 2015

0 votos

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)

Más respuestas (0)

Preguntada:

el 17 de Abr. de 2015

Editada:

el 17 de Abr. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by