程序中,fit数组为综合指标。停止准则是设定的叠带次数。程序结束时,如仍不满足指标,则将最佳结果代替初始参数,重新执行程序。以下是程序清单:
function tayloro
% 优化组合参数 ,用动态优选法优化
clear
disp('输入参数');
B=input( '带宽 (MHZ):');T=input('时宽(us):');fc=input('抽样率(*B):');
delt=1/fc;N=T/delt;M=5;
for z=1:50 % 设定总的叠代次数为50
g1(z)=1+(rand(1)-1)/10;g2(z)=1+(rand(1)-1)/10;g3(z)=1+(rand(1)-1)/10;g4(z)=1+(rand(1)-1)/10;g5(z)=1+(rand(1)-1)/10;
a=[0.42825,0.0002,0.00427,-0.00193,0.00074];
a(1)=a(1)*g1(z);a(2)=a(2)*g2(z);a(3)=a(3)*g3(z);a(4)=a(4)*g4(z);a(5)=a(5)*g5(z); % 在窗函数附近选定一组初始值
N1=1;
1