⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 da_shtgs.m

📁 王小平《遗传算法——理论、应用与软件实现》随书光盘
💻 M
字号:
%
% da_shtags.m
%
f=figure(2);
clg;
set(f,'position',[40 40 400 400],'number','off','name','I/O Tags selected','resize','off','menu','none');

box1=uicontrol(f,...
	'style','frame',...
	'position',[10 10 180 380],...
	'foregroundColor',[1 1 1],...
	'backgroundcolor',[0 0 0.5]);

box1=uicontrol(f,...
	'style','frame',...
	'position',[210 10 180 380],...
	'foregroundColor',[1 1 1],...
	'backgroundcolor',[0.5 0 0]);

iotext(1)=da_text2(f,15,365,170,20,'Inputs Selected',[1 1 1],[0 0.5 0],'center');
iotext(2)=da_text2(f,215,365,170,20,'Outputs Selected',[1 1 1],[0 0.5 0],'center');
iobut(1)=uicontrol(f,'style','push','position',[15 335 170 20],'string','Scroll up');
iobut(2)=uicontrol(f,'style','push','position',[215 335 170 20],'string','Scroll up');
iobut(3)=uicontrol(f,'style','push','position',[15 15 170 20],'string','Scroll down');
iobut(4)=uicontrol(f,'style','push','position',[215 15 170 20],'string','Scroll down');
iotext(3)=da_text(f,15,300,50,20,'Input',[1 1 1],[0 0 0.5]);
iotext(4)=da_text(f,130,300,30,20,'Tag',[1 1 1],[0 0 0.5]);
iotext(5)=da_text(f,215,300,50,20,'Input',[1 1 1],[0.5 0 0]);
iotext(6)=da_text(f,320,300,30,20,'Tag',[1 1 1],[0.5 0 0]);

%
% Draw the blank boxes
% 
for i=1:10
	iotext(20+i)=da_text2(f,15,270-((i-1)*25),30,20,'',[1 1 1],[0 0.5 0],'center');
	iotext(30+i)=da_text2(f,55,270-((i-1)*25),120,20,'',[1 1 1],[0.5 0 0],'left');
	iotext(40+i)=da_text2(f,215,270-((i-1)*25),30,20,'',[1 1 1],[0 0.5 0],'center');
	iotext(50+i)=da_text2(f,255,270-((i-1)*25),120,20,'',[1 1 1],[0 0 0.5],'left');
end

%
% Put in the tag names
%
spl=2;
out_count=1;
in_count=1;
[num_meas num_inp]=size(data);
for i=1:10
	set(iotext(40+i),'string','');
	set(iotext(50+i),'string','');
	if i-1+spl<=num_inp
		if include_var(spl+i-1)==1
			if output_var(i-1+spl)==1
				set(iotext(50+out_count),'string',out_tags(out_count+spl-1,:));
				set(iotext(40+out_count),'string',['y' num2str(out_count+spl-1)]);
				out_count=out_count+1;
			end

		end
	end
end

for i=1:10
	set(iotext(20+i),'string','');
	set(iotext(30+i),'string','');
	if i-1+spl<=num_inp
		if include_var(spl+i-1)==1 & output_var(spl+i-1)==0
			set(iotext(30+in_count),'string',in_tags(in_count+spl-1,:));
			set(iotext(20+in_count),'string',['u' num2str(in_count+spl-1)]);
			in_count=in_count+1;
		end
	end
end


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -