sa_set.m

来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 131 行

M
131
字号
%sa_set
%modified by D. G. Childers 7/8/98

sa_h=figure('Position',[210 45 400 252], 'NumberTitle','off',...
		'Resize','off','Name','Simulated Annealing Window', ...
		'color',BACK_COLOR);

sa_itemp_h = uicontrol('Style','slider','Position', ...
		[210 224 100 20],'Min',1,'Max',1000,'Value',10, ...
 		'Callback', ...
	'set(sa_e_itemp_h,''String'',round(get(sa_itemp_h,''Value'')))');
sa_e_itemp_h=uicontrol('Style','edit','Position', ...
		[150 224 50 19],'Callback', ...
	'set(sa_itemp_h,''Value'',eval(get(sa_e_itemp_h,''String'')))');
set(sa_e_itemp_h,'String',10);
%uicontrol('Style','text','Position', ...
%		[25 355 55 15],'string','Initial Temp.:');
axis('off');
ss=sprintf('Initial Temp. :');
text(-0.07,1,ss,'color',TEXT_COLOR,'FontSize',10);
ss=sprintf('*(0.01)');
text(0.87,1,ss,'color',TEXT_COLOR,'FontSize',10);

sa_temprf_h = uicontrol('Style','slider','Position', ...
		[210 200 100 20],'Min',1,'Max',100,'Value',85, ...
 		'Callback', ...
	'set(sa_e_temprf_h,''String'',round(get(sa_temprf_h,''Value'')))');
sa_e_temprf_h=uicontrol('Style','edit','Position', ...
		[165 200 35 19],'Callback', ...
	'set(sa_temprf_h,''Value'',eval(get(sa_e_temprf_h,''String'')))');
set(sa_e_temprf_h,'String',85);
%uicontrol('Style','text','Position', ...
%		[25 335 55 15],'string','Temp. reduc. factor:');
ss=sprintf('Temp. reduc. factor :');
text(-0.07,0.884,ss,'color',TEXT_COLOR,'FontSize',10);
ss=sprintf('*(0.01)');
text(0.87,0.884,ss,'color',TEXT_COLOR,'FontSize',10);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sa_errt_h = uicontrol('Style','slider','Position', ...
		[210 176 100 20],'Min',1,'Max',100,'Value',50, ...
 		'Callback', ...
	'set(sa_e_errt_h,''String'',round(get(sa_errt_h,''Value'')))');
sa_e_errt_h=uicontrol('Style','edit','Position', ...
		[165 176 35 19],'Callback', ...
	'set(sa_errt_h,''Value'',eval(get(sa_e_errt_h,''String'')))');
set(sa_e_errt_h,'String',50);
%uicontrol('Style','text','Position', ...
%		[25 305 150 20],'string','Error Tol.:');
ss=sprintf('Error Tol. :');
text(-0.07,0.77,ss,'color',TEXT_COLOR,'FontSize',10);
ss=sprintf('*(0.001)');
text(0.87,0.77,ss,'color',TEXT_COLOR,'FontSize',10);


sa_cycle_h = uicontrol('Style','slider','Position', ...
		[210 154 100 20],'Min',1,'Max',100,'Value',20, ...
 		'Callback', ...
	'set(sa_e_cycle_h,''String'',round(get(sa_cycle_h,''Value'')))');
sa_e_cycle_h=uicontrol('Style','edit','Position', ...
		[165 154 35 19],'Callback', ...
	'set(sa_cycle_h,''Value'',eval(get(sa_e_cycle_h,''String'')))');
set(sa_e_cycle_h,'String',20);
ss=sprintf('No. of Cycles :');
text(-0.07,0.656,ss,'color',TEXT_COLOR,'FontSize',10);

%uicontrol('Style','text','Position', ...
%		[25 260 55 15],'string','No. of Cycles:');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sa_iter_h = uicontrol('Style','slider','Position', ...
		[210 130 100 20],'Min',1,'Max',20,'Value',5, ...
 		'Callback', ...
	'set(sa_e_iter_h,''String'',round(get(sa_iter_h,''Value'')))');
sa_e_iter_h=uicontrol('Style','edit','Position', ...
		[165 130 35 19],'Callback', ...
	'set(sa_iter_h,''Value'',eval(get(sa_e_iter_h,''String'')))');
set(sa_e_iter_h,'String',5);
%uicontrol('Style','text','Position', ...
%		[25 205 75 15],'string','No. of iterations:');
ss=sprintf('No. of iterations :');
text(-0.07,0.542,ss,'color',TEXT_COLOR,'FontSize',10);

sa_eval_h = uicontrol('Style','slider','Position', ...
		[210 107 100 20],'Min',10,'Max',20000,'Value',5001, ...
 		'Callback', ...
	'set(sa_e_eval_h,''String'',round(get(sa_eval_h,''Value'')))');
sa_e_eval_h=uicontrol('Style','edit','Position', ...
		[150 107 50 19],'Callback', ...
	'set(sa_eval_h,''Value'',eval(get(sa_e_eval_h,''String'')))');
set(sa_e_eval_h,'String',5001);
ss=sprintf('Max. No. of Eval. :');
text(-0.07,0.428,ss,'color',TEXT_COLOR,'FontSize',10);

%uicontrol('Style','text','Position', ...
%		[25 165 35 15],'string','Max. No. of Eval.:');


sa_ran1_h = uicontrol('Style','slider','Position', ...
		[210 84 100 20],'Min',1,'Max',31328,'Value',1, ...
 		'Callback', ...
	'set(sa_e_ran1_h,''String'',round(get(sa_ran1_h,''Value'')))');
sa_e_ran1_h=uicontrol('Style','edit','Position', ...
		[150 84 50 19],'Callback', ...
	'set(sa_ran1_h,''Value'',eval(get(sa_e_ran1_h,''String'')))');
set(sa_e_ran1_h,'String',1);
ss=sprintf('rand. seed 1 :');
text(-0.07,0.314,ss,'color',TEXT_COLOR,'FontSize',10);

%uicontrol('Style','text','Position', ...
%		[25 145 80 15],'string','rand. seed 1:');

sa_ran2_h = uicontrol('Style','slider','Position', ...
		[210 61 100 20],'Min',1,'Max',30081,'Value',2, ...
 		'Callback', ...
	'set(sa_e_ran2_h,''String'',round(get(sa_ran2_h,''Value'')))');
sa_e_ran2_h=uicontrol('Style','edit','Position', ...
		[150 61 50 19],'Callback', ...
	'set(sa_ran2_h,''Value'',eval(get(sa_e_ran2_h,''String'')))');
set(sa_e_ran2_h,'String',2);
ss=sprintf('rand. seed 2 :');
text(-0.07,0.20,ss,'color',TEXT_COLOR,'FontSize',10);

uicontrol('Style','Pushbutton','Position',[100 15 60 25], ...
	'String','Default','Callback','sa_defau');
uicontrol('Style','Pushbutton','Position',[250 15 60 25], ...
	'String','Start','Callback','sa_start');


⌨️ 快捷键说明

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