Effacer les filtres
Effacer les filtres

How can I get outcome at a particular value after performing differentiation?

3 vues (au cours des 30 derniers jours)
Hello,
I would like to know how I can get outcome at a particular value after performing "differentiation" of a function using Matlab code. For example, after obtaining the first derivative of the particular function x^2-2*x+6, substituting x=3 into the derivative, then the outcome will be 4. See the simple program I've constructed, and please let me know how to fix the error.
syms x
f=x^2-2*x+6;
diff(f,x=2)

Réponse acceptée

Walter Roberson
Walter Roberson le 16 Fév 2019
subs(diff(f,x),x,2)

Plus de réponses (1)

madhan ravi
madhan ravi le 16 Fév 2019
Another option:
dx(x)=diff(f);
dx(3)

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