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
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
阅读全文
0 0
- The program of choosing THREE parameters
- The program of choosing TWO parameters
- The Rule of Three
- The Rule of Three
- Write a program that prints the numbers from 1 to 100,but for multiples of three print “Fizz” inste
- The Three Faces of SOA
- The Three Kinds of Laziness
- The principles of program design
- The method of parameters given in Python
- [torch]nngraph parameters of the node
- the program of the icisc 2011
- [收藏]The three kinds of aspect configuration
- [收藏]The three kinds of aspect configuration
- [收藏]The three kinds of aspect configuration
- Object-oriented of the three basic characteristics
- The three classes of devices and modules
- The maximum of three numbers code
- What is The Rule of Three?
- cvte题
- 三天打渔,两天晒网(C)
- Jquery 中 ajaxSubmit使用讲解
- 【编程题】 丑陋的字符串
- 堆与栈
- The program of choosing THREE parameters
- JSDOM编程艺术
- Draftjs 输出结果 转换回html(converToHtml)
- PAT 乙级 1029
- 基于python的web开发(一)——TCP/IP
- php写自定义数字加解密函数
- 【codeforces 750A】New Year and Hurry
- 2.理解merge和pushStack可以更好的了解jQuery原码
- druid 元数据接口查询