Create an anonymous function after Symbolic differentiation
Mostrar comentarios más antiguos
I want to differentiate a function f and the calculate the derivative of f at value of x. How can I do that? for example:
syms x
f=@(x) x^3+3*x+1;
g=diff(f(x))
Preferably I would like to create a function handle of the derivative and then calculate the derivative at x.
Respuesta aceptada
Más respuestas (1)
Iman Ansari
el 13 de Mayo de 2013
Hi.
syms x
f=@(x) x^3+3*x+1;
g=diff(f(x))
h=@(y) subs(g,y)
2 comentarios
Giorgos Papakonstantinou
el 13 de Mayo de 2013
Giorgos Papakonstantinou
el 13 de Mayo de 2013
Categorías
Más información sobre Function Creation en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!