|
楼主 |
发表于 2008-5-6 17:43
|
显示全部楼层
这位大哥,我改了,可还不行啊!还得求求你帮帮忙啊!
fuction F=mymfun(x)
f(1)=0.5*x(1).*exp(-0.25*pi*(x-x(2)).^2);
f(2)=sqrt(1+(0.25*pi*x(1).*(x-x(2))).^2.*exp(-0.5*pi*(x-x(2)).^2));
sym x
F(1)=quad(f(1),0,inf);
F(2)=quad(f(2),-inf,inf);
F=[F(1);F(2)];
然后我在Command里引用
>> x0=[-1000000;1000000];
>> options=optimset('Display','iter');
>> [x,fval]=fsolve(@opt30_5o,x0,options)
Warning: feval on script names will not work, or may work differently,
in a future version of MATLAB. To make your code insensitive to any change
and to suppress this warning message:
- Either change the script to a function.
- Or use eval instead of feval.
The script file in question is opt30_5o.
> In fsolve at 180
??? Attempt to execute SCRIPT opt30_5o as a function.
Error in ==> fsolve at 180
fuser = feval(funfcn{3},x,varargin{:});
还是不行,这回我跟蒙了,我是个新手,不太会,谢谢了! |
|