I have a Matlab function G(x,y,z)
. At each given (x,y,z)
, G(x,y,z)
is a scalar. x=(x1,x2,...,xK)
is a Kx1
vector.
Let us fix y,z
at some given values. I would like your help to understand how to compute the derivative of G
with respect to xk
evaluated at a certain x
.
For example, suppose K=3
function f= G(x1,x2,x3,y,z)
f=3*x1*sin(z)*cos(y)+3*x2*sin(z)*cos(y)+3*x3*sin(z)*cos(y);
end
How do I compute the derivative of G(x1,x2,x3,4,3)
wrto x2
and then evaluate it at x=(1,2,6)
?