I have this code:
syms x y z
f =[x^2+y^2+z^2-100 ,x*y*z-1 ,x-y-sin(z)];
v = [x, y, z];
fp = jacobian(f,v)
This gives:
fp =
[ 2*x, 2*y, 2*z]
[ y*z, x*z, x*y]
[ 1, -1, -cos(z)]
Now I want to evaluate this at, say, x=y=z=1. But
fp([1,1,1])
gives me
[ 2*x, 2*x, 2*x]
Is there a way to do this?
You can use the subs
function:
subs(fp, [x y z], [1 1 1])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With