MATLAB: Partial Differentiation of a function

partial differentiation

syms x y
f=x^2+2*y^2-22
P=diff(f,x)
Here, I have calculated the (partial) differentiation of function "f" w.r.t 'x'
Now, I want to know the value of 'P' at certain point (say x=1.5, y=2.0)
Please help!

Best Answer

One of the possibilities:
syms x y
f=x^2+2*y^2-22
P=diff(f,x)
subs(P,{x,y},{1.5,2})