how to obtain anonymous function after derivative ?

6 vues (au cours des 30 derniers jours)
Masoud Nateghi
Masoud Nateghi le 28 Mar 2020
Hi,
can we have an anonymous function after we differntiate an anonymous function? for example see blow
f = @(x) x^4+3*x^2;
now I want to have another anonymous function which is derivative of f(x) .
  1 commentaire
Walter Roberson
Walter Roberson le 28 Mar 2020
How are you differentiating the anonymous function?

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 28 Mar 2020
syms x
df = matlabFunction(diff(f(x), x), 'vars', {x})

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by