我按照书上的思路编了一个程序,可是有如下错误,不知道为什么,哪位大侠帮帮忙!<BR>首先定义了一个fmincono.m文件<BR>function f=myfun(x)<BR>f=3.12(((x(1)-3.2)^2+(x(2)-6.34)^2)^0.5+((x(1)-1.31)^2+(x(2)-4.67)^2)^0.5);<BR>然后运行<BR>x0=[25;400];<BR>>> lb=[0;3];<BR>>> ub=[500;600];<BR>>> x=fmincon(@fmincono,x0,[],[],[],[],lb,ub)<BR>Warning: Large-scale (trust region) method does not currently solve this type of problem,<BR>switching to medium-scale (line search).<BR>> In fmincon at 260<BR>??? Error using ==> fmincon<BR>FMINCON cannot continue because user supplied objective function failed with the following error:<BR>Error using ==> feval<BR>Undefined command/function 'fmincono'.<BR>实在是不知道是什么问题<BR>而且我把书上的例子写进去,也出现相同的错误。 <BR><BR> |