📄 sysiden.asv
字号:
%系统辨识
%delete(f_1);
set(gcf,'DefaultTextFontSize',12)
set(f_1,'visible','off');
%set(m_1ctrlt,'visible','off');
set(gcf,'defaultuicontrolunits','normalized');
H=axes('unit','normalized','position',[0,0,1,1],'visible','off');
%全局设置
top=0.98;
bottom=0.1;
left=0.01;
right=0.95;
textHeight = 0.03;
textWidth = 0.12;
labelWidth= 0.13;
radioWidth=0.25;
spacing=0.02;
%ga 参数
labelBottom=top-textHeight-spacing;
labelLeft = left+0.05;
frmPos=[left+0.03 labelBottom-4*textHeight-5*spacing 0.29 5*textHeight+6*spacing];
f_2=uicontrol('style','frame','position',frmPos,'background',[0.3 0.3 0.3],'foreground','Yellow');
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_1 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','变异概率', ...
'Interruptible','off', ...
'BackgroundColor',[0.3 0.3 0.3], ...
'ForegroundColor','white',...
'TooltipString','Sampling Frequency');
%text(0.1,0.95,'变异概率:','fontsize',10);
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_pmutation= uicontrol( ...
'Style','edit', ...
'Units','normalized', ...
'Position',textPos, ...
'Horiz','center', ...
'Background','white', ...
'Foreground','black', ...
'String','0.015','Userdata',0.015);
labelBottom=top-2*textHeight-2*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_2 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','交叉概率', ...
'Interruptible','off', ...
'BackgroundColor',[0.3 0.3 0.3], ...
'ForegroundColor','white');
%text(0.1,0.85,'交叉概率:','fontsize',10);
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_pcross=uicontrol( ...
'Style','edit', ...
'Units','normalized', ...
'Position',textPos, ...
'Horiz','center', ...
'Background','white', ...
'Foreground','black', ...
'String','0.1','Userdata',0.1);
%uicontrol(gcf,'style','edit','background','white',...
% 'position',[0.25,0.825,0.15,0.05],'string','0.1');
labelBottom=top-3*textHeight-3*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_3 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','最大世代数', ...
'Interruptible','off', ...
'BackgroundColor',[0.3 0.3 0.3], ...
'ForegroundColor','white');
%text(0.1,0.75,'最大世代数:','fontsize',10);
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_maxgen=uicontrol( ...
'Style','edit', ...
'Units','normalized', ...
'Position',textPos, ...
'Horiz','center', ...
'Background','white', ...
'Foreground','black', ...
'String','50','Userdata',50);
%uicontrol(gcf,'style','edit','background','white',...
% 'position',[0.25,0.725,0.15,0.05],'string','50');
labelBottom=top-4*textHeight-4*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_4 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','染色体长度', ...
'Interruptible','off', ...
'BackgroundColor',[0.3 0.3 0.3], ...
'ForegroundColor','white');
%text(0.1,0.65,'染色体长度:','fontsize',10);
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_lchrom=uicontrol( ...
'Style','edit', ...
'Units','normalized', ...
'Position',textPos, ...
'Horiz','center', ...
'Background','white', ...
'Foreground','black', ...
'String','8','Userdata',8);
%uicontrol(gcf,'style','edit','background','white',...
% 'position',[0.25,0.625,0.15,0.05],'string','8');
labelBottom=top-5*textHeight-5*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_5 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','种群大小', ...
'Interruptible','off', ...
'BackgroundColor',[0.3 0.3 0.3], ...
'ForegroundColor','white');
%text(0.1,0.55,'种群大小:','fontsize',10);
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_popsize=uicontrol( ...
'Style','edit', ...
'Units','normalized', ...
'Position',textPos, ...
'Horiz','center', ...
'Background','white', ...
'Foreground','black', ...
'String','20','Userdata',20);
%阶次选择
%text(0.6,0.86,'对象级别:','fontsize',10);
labelBottom=top-6*textHeight-8*spacing;
labelPos = [labelLeft labelBottom radioWidth textHeight];
frmPos=[left+0.03 labelBottom-2*textHeight-3*spacing 0.29 3*textHeight+4*spacing];
f_3=uicontrol('style','frame','position',frmPos,'background',[0.3 0.3 0.3],'foreground','Yellow');
labelPos = [labelLeft labelBottom radioWidth textHeight];
r_order1=uicontrol(gcf,'style','radio','string','非线性系统辨识',...
'position',labelPos);
set(r_order1,'value',get(r_order1,'Max'));
order=1;
isysiden=imread('sysidenann.jpg');
h=axes('position',[0.4 0.12 0.45 0.34]);
im_sysiden=image(isysiden);
set(h,'visible','off');
set(r_order1,'callback',['order=1;',...
'set(r_order1,''value'',get(r_order1,''Max'')),',...
'set(r_order2,''value'',get(r_order2,''Min'')),',...
'set(r_order3,''value'',get(r_order3,''Min'')),',...
'set(e_gsm1,''enable'',''off''),',...
'set(e_gsm2,''enable'',''off''),',...
'set(e_gsm3,''enable'',''off''),',...
'set(e_gsn1,''enable'',''off''),',...
'set(e_gsn2,''enable'',''off''),',...
'set(e_gsn3,''enable'',''off''),',...
'set(e_gszh,''enable'',''off''),',...
' isysiden=imread(''sysidenann.jpg'');',...
' h=axes(''position'',[0.4 0.12 0.45 0.34]);',...
'delete(im_sysiden);',...
'im_sysiden=image(isysiden);',...
'set(h,''visible'',''off'');',...
]);
labelBottom=top-7*textHeight-9*spacing;
labelPos = [labelLeft labelBottom radioWidth textHeight];
r_order2=uicontrol(gcf,'style','radio','string','二阶系统 ',...
'position',labelPos);
set(r_order2,'callback',[...
'order=2;set(r_order2,''value'',get(r_order2,''Max'')),',...
'set(r_order1,''value'',get(r_order1,''Min'')),',...
'set(r_order3,''value'',get(r_order3,''Min'')),',...
'set(e_gsm1,''enable'',''on''),',...
'set(e_gsm2,''enable'',''on''),',...
'set(e_gsm3,''enable'',''off''),',...
'set(e_gsn1,''enable'',''on''),',...
'set(e_gsn2,''enable'',''on''),',...
'set(e_gsn3,''enable'',''off''),',...
'set(e_gszh,''enable'',''on''),',...
'isysiden=imread(''2.bmp'');',...
'h=axes(''position'',[0.5 0.3 0.2 0.1]);',...
'delete(im_sysiden);',...
'im_sysiden=image(isysiden);',...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -