Hello, You can use diff function operator to obtain partial derivatives as follows:
1- Define a function using syms function. (symbolic variable)
syms x y;
f = @(x,y) x^2 + y^2 + x*y;
2-use diff with respect to the variable you want to differentiate.
z(x,y) = diff(f,x)
z(x,y) = 2*x+y;
You can also find the value of parial differential at a point by calling z at a given point.