MATLAB: How do you do a derivative with a certain value

derivativesSymbolic Math Toolbox

My initial equation is f(x) = (3*x^5)-(x^3)+(2*x^2)+4 and when I derive that, I get f'(x)=15*x^4 – 3*x^2 + 4*x. How do I evaluate f'(x) when x = 1.7?
So far I have done this:
clear all, close all
syms x f = (3*x^5)-(x^3)+(2*x^2)+4; diff(f)
This gives me the derivative, but how do I find the value of f'(x) when I have a value for x?

Best Answer

Yianni - try using subs as
syms x
f = (3*x^5)-(x^3)+(2*x^2)+4;
df = diff(f);
result = double(subs(df,1.7));