clear all;
clc; 全部关闭
%rand('state),0 ) ) ) ) ) ) ) ) ) ) ) )。
警告关闭
global t vt
load S.dat -ascii
t=s (3360,1 );
vt=s (3360,2 );
options=gaoptimset('plotfcns ',{[]} );
options=gaoptimset(options,' PopulationType ',' doubleVector ' ); % 'bitstring '
options=gaoptimset(options,' Display ',' final ' );
options=gaoptimset(options,' PopInitRange ',[0.01 0.01; 50 50] );
options=gaoptimset(options,' PopulationSize ',40,
' CrossoverFraction ',0.8,
' Generations ',MaxDT,
' MutationFcn ',{@mutationuniform,0.2},
' StallGenLimit ',1000,' StallTimeLimit ',1000;
dims=5;
tic
% run ga
tc=toc
lt=linspace (0.01,10,200 );
f1=[]; f2=[]; f3=[];
%LV=x(1).//) ) 1x )2).*lt ).^2);
%LV=polyval(x,lt );
f1=x(1)./) 1x )2).*lt ).^2);
f2=-(x(3).* ) *(lt.^2) x )4).*lt )./) ltx )5);
F3=1-exp(F2;
lv=f1.*f3;
%------最后给出计算结果
disp (* * * * * * * * * * * * * * * * * * * * * * * * * * * disp
disp '重复次数:')
disp '函数的全局最佳位置是'
x
disp (最终得到的优化极值为) ) ) ) ) ) )。
Result=Fval % or Result=out
figure (; plot(t,vt,' b* ',lt,lv,' r-' )
---------算法结束了---------算法结束了
disp (* * * * * * * * * * * * * * * * * * * * * * * * * * * disp