请教高手:我这个程序错在哪里?
syms x1 x2 ar;f=x1^2+4*x2^2;
v=[x1,x2];
df=jacobian(f,v);
df=df.';
epson=2e-3;x0=[2,2]';g1=subs(df,{x1,x2},{x0(1,1),x0(2,1)});k=0;
while(norm(g1)>epson)
p=-g1;
y=subs(f,{x1,x2},{x0(1,1)+ar*p(1,1),x0(2,1)+ar*p(2,1)});
dy=diff(y);
arf=solve(dy);
x0=x0+arf*p;
g1=subs(df,{x1,x2},{x0(1,1),x0(2,1)});
k=k+1;
Y=subs(f,{x1,x2},{x0(1,1),x0(2,1)});
end;
k
x0
Y