The program of choosing THREE parameters

来源:互联网 发布:c语言物业费管理系统 编辑:程序博客网 时间:2024/05/19 15:39
%The program of choosing THREE parameters
clear
tic;
format long g
pp=1;
%% c1,c2,c3 are parameters,ee is used to store the test results
start1=   ;
end1=   ;
step1=   ;
c1=start1:step1:end1;
l1=length(c1);


start2=  ;
end2=  ;
step2=  ;
c2=start2:step2:end2;
l2=length(c2);


start3=  ;   
end3=  ;
step3=   ;
c3=start3:step3:end3;
l3=length(c3);


ee=ones(l3,l2,l1);
ee=10.*ee;


ii=1;
for c1=start1:step1:end1  
    jj=1;
    for c2=start2:step2:end2
        kk=1;
        for c3=start3:step3:end3


            
            
ee(kk,jj,ii)=  ;
pp=pp+1
       kk=kk+1;
    end
       jj=jj+1;
    end
       ii=ii+1;
end


TIME=toc
minpu=min(min(min(ee)))
[c,d]=find(minpu==ee);
 mi=size(ee);
 mm=mi(2);
 
 if length(c)>1 
       disp( sprintf('找到 %d 个c , d',length(c)))
    c'
    d'
    for ki=1:length(c)
        xi=c(ki);
        zi=ceil(d(ki)/mm);
        yi=d(ki)-(zi-1)*mm;
     disp( sprintf('====================== %d =======================',ki))
OPT_c1=start1+step1*(zi-1)
OPT_c2=start2+step2*(yi-1)
OPT_c3=start3+step3*(xi-1)
    end


 else
disp('*****************只找到 1 个c , d*******************')
xi=c;
zi=ceil(d/mm);
yi=d-(zi-1)*mm; 
OPT_c1=start1+step1*(zi-1)
OPT_c2=start2+step2*(yi-1)
OPT_c3=start3+step3*(xi-1)
 end