其中 ,要求选取初始点 ,终止误差 . 编写M文件detaf.m如下 function [f,df]=detaf(x); f=x(1)^2+25*x(2)^2; df(1)=2*x(1); df(2)=50*x(2); (ii)编写M文件zuisu.m clc x=[2;2]; [f0,g]=detaf(x); while norm(g)>0.000001 p=-g'/norm(g); t=1.0;f=detaf(x+t*p); while f>f0 t=t/2;f=detaf(x+t*p); end x=x+t*p [f0,g]=detaf(x) end