how to obtain anonymous function after derivative ?

4 visualizzazioni (ultimi 30 giorni)
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) .

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by