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

1 回表示 (過去 30 日間)
onsagerian
onsagerian 2019 年 2 月 15 日
コメント済み: onsagerian 2019 年 2 月 17 日
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)

採用された回答

Walter Roberson
Walter Roberson 2019 年 2 月 16 日
subs(diff(f,x),x,2)

その他の回答 (1 件)

madhan ravi
madhan ravi 2019 年 2 月 16 日
Another option:
dx(x)=diff(f);
dx(3)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by