Maximum number of function evaluations exceeded; increase OPTIONS.MaxFunEvals.
怎么改啊,求大俠指點。〖奔奔!好久了都沒弄出來!
function fmin=zener(x)clear;clc;global A f ED CD fmax delta
A=[2 2];
f=[15 30];
ED=[1281.1 1336.7];
fmax=ED.*A;
delta=[0.103 0.115];
x0=[650;1;1300];
[x,fval,exitflag]=fmincon(@myfun,x0,[],[],[],[],[0;0;0],[])
function ffsum=myfun(x)
global A f ED CD fmax delta
for i=1:1:2
Ere(i)=x(3)+x(1)*(2*pi*f(i)*x(2))^2/(x(1)^2+(2*pi*f(i)*x(2))^2);
Eim(i)=x(1)^2*2*pi*f(i)*x(2)/(x(1)^2+(2*pi*f(i)*x(2))^2);
ff(i)=abs(((Ere(i)^2+Eim(i)^2)^0.5)-fmax(i)/A(i))/(fmax(i)/A(i))*100+abs(Eim(i)/(Ere(i)^2+Eim(i)^2)^0.5-sin(delta(i)))/sin(delta(i))*100;
end
ffsum=ff(1)+ff(2);
|