新手遇到的问题!
options = optimset('fminunc');options = optimset(options,'largescal','off');
options = optimset(options,'maxfunevals',300);
options = optimset(options,'hessupdate','bfgs');
options = optimset(options,'linesearch','cubicpoly');
x0=[-1.9 2];
grad =[100*(4*x(1)^3-4*x(1)*x(2))+2*x(1)-2;100*(2*x(2)-2*x(1)^2);banplot2(x)]';
f=100*(x(2)-x(1))^2+(1-x(1))^2;
options=optimset(options,'gradobj','on');
disp('[x,fval,exitflag,output]') = fminunc({f,grad},x0,options);
[x,fval,exitflag,output]= fminunc({f,grad},x0,options);
??? Undefined function or method 'x' for input arguments of type 'double'.