gerry 发表于 2007-3-13 20:21

无法求极值的多元函数?

第一次用fmin,简化函数及错误提示如下,看不出问题出在哪里,请各位帮忙

fua =

(500*x(3)*x(2)^2-107/10)^2+(25/2*x(2)-9)^2+(1000/89*x(1)-824/89)^2

>> x0
x0 =
    0.8240    0.7200    0.0413

>> fminunc(fua,x0)

??? Error using ==> optimfcnchk
If FUN is a MATLAB object, it must have an feval method.
Error in ==> fminunc at 192
   funfcn = optimfcnchk(FUN,'fminunc',length(varargin),funValCheck,gradflag,hessflag);

>> fminsearch(fua,x0)

??? Error using ==> fcnchk
If FUN is a MATLAB object, it must have an feval method.
Error in ==> fminsearch at 178
funfcn = fcnchk(funfcn,length(varargin));

xjzuo 发表于 2007-3-14 17:22

回复

这种简单问题建议 help fminunc,help fminsearch, 自己看看相信就能解决.
提示:先定义你的函数为inline函数即可.
页: [1]
查看完整版本: 无法求极值的多元函数?