First I write a function as follow:
syms x y zf = [x*y*z; y; x + z];v = [x, y, z]; R = jacobian(f, v);As just you said, to get the value of R at the particular value of x,y,z, I can use subs(R,[x,y,z],{1,2,3});However, if z is a vector, and I want to compute the each value of R by using each element of z and the value of x,y, hence, I made a loop as follow:%Consider x=1;y=2;z=[1 2 3];
for i = 1:size(z)t = z(i);R(:,:,i)=subs(R,[x,y,z],{1,2,t});endhowever, it doesn't work, because t can not be instead by each value in vector z, what shall I do on this?Thank you very much!
Best Answer