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

📄 sysiden.m

📁 这是一个遗传算法的优化软件
💻 M
📖 第 1 页 / 共 2 页
字号:
         'set(h,''visible'',''off'');',...
               ]);
labelBottom=top-8*textHeight-10*spacing;
labelPos = [labelLeft labelBottom radioWidth textHeight];
r_order3=uicontrol(gcf,'style','radio','string','三阶系统 ',...
    'position',labelPos);
set(r_order3,'callback',[...
         'order=3;set(r_order3,''value'',get(r_order3,''Max'')),',...
         'set(r_order1,''value'',get(r_order1,''Min'')),',...
         'set(r_order2,''value'',get(r_order2,''Min'')),',...
         'set(e_gsm1,''enable'',''on''),',...
         'set(e_gsm2,''enable'',''on''),',...
         'set(e_gsm3,''enable'',''on''),',...
         'set(e_gsn1,''enable'',''on''),',...
         'set(e_gsn2,''enable'',''on''),',...
         'set(e_gsn3,''enable'',''on''),',...
         'set(e_gszh,''enable'',''on''),',...
         'isysiden=imread(''3.bmp'');',...
         'h=axes(''position'',[0.45 0.25 0.3 0.15]);',...
         'delete(im_sysiden);',...
         'im_sysiden=image(isysiden);',...
         'set(h,''visible'',''off'');',...
               ]);

%输入信号

labelBottom=top-9*textHeight-13*spacing;
frmPos=[left+0.03 labelBottom-6*textHeight-6*spacing 0.29 7*textHeight+7*spacing];
f_4=uicontrol('style','frame','position',frmPos,'background',[0.3 0.3 0.3],'foreground','Yellow');

labelPos = [labelLeft labelBottom radioWidth textHeight];
r_jyin=uicontrol(gcf,'style','radio','string','阶跃信号 ',...
     'position',labelPos);
set(r_jyin,'value',get(r_jyin,'Max'));
rstyle=1;

set(r_jyin,'callback',[...
         'set(r_jyin,''value'',get(r_jyin,''Max'')),',...
         'set(r_xpin,''value'',get(r_xpin,''Min'')),',...
         'set(r_zdyin,''value'',get(r_zdyin,''Min'')),',...
         'set(t_rin,''string'',''输入信号: ''),',...
         'set(e_rin,''string'',''1''),',...
         'rstyle=1;',...
               ]);
labelBottom=top-10*textHeight-14*spacing;
labelPos = [labelLeft labelBottom radioWidth textHeight];
r_xpin=uicontrol(gcf,'style','radio','string','斜坡信号',...
    'position',labelPos);
set(r_xpin,'callback',[...
         'set(r_jyin,''value'',get(r_jyin,''Min'')),',...
         'set(r_xpin,''value'',get(r_xpin,''Max'')),',...
         'set(r_zdyin,''value'',get(r_zdyin,''Min'')),',....
         'set(t_rin,''string'',''输入信号斜率:''),',...
         'set(e_rin,''string'',''1''),',...
         'rstyle=2;',...
               ]);
labelBottom=top-11*textHeight-15*spacing;
labelPos = [labelLeft labelBottom radioWidth textHeight];
r_zdyin=uicontrol(gcf,'style','radio','string','自定义信号',...
    'position',labelPos);
set(r_zdyin,'callback',[...
         'set(r_jyin,''value'',get(r_jyin,''Min'')),',...
         'set(r_xpin,''value'',get(r_xpin,''Min'')),',...
         'set(r_zdyin,''value'',get(r_zdyin,''Max'')),',....
         'set(t_rin,''string'',''输入信号样本文件:''),',...
         'set(e_rin,''string'',pwd),',...
         'rstyle=3;',...
               ]);

          
labelBottom=top-12*textHeight-16*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
t_rin = uicontrol( ...
	'Style','text', ...
	'Units','normalized', ...
	'Position',labelPos, ...
	'Horiz','left', ...
	'String','输入信号:', ...
	'Interruptible','off', ...
	'BackgroundColor',[0.3 0.3 0.3], ...
	'ForegroundColor','white');
e_rin=uicontrol( ...
	'Style','edit','max',2,...
	'Units','normalized', ...
	'Position',textPos, ...
	'Horiz','center', ...
	'Background','white', ...
	'Foreground','black', ...
	'String','1');
labelBottom=top-14*textHeight-17*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_6 = uicontrol( ...
	'Style','text', ...
	'Units','normalized', ...
	'Position',labelPos, ...
	'Horiz','left', ...
	'String','采样周期(s)', ...
	'Interruptible','off', ...
	'BackgroundColor',[0.3 0.3 0.3], ...
	'ForegroundColor','white');
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_ts=uicontrol( ...
	'Style','edit', ...
	'Units','normalized', ...
	'Position',textPos, ...
	'Horiz','center', ...
	'Background','white', ...
	'Foreground','black', ...
	'String','0.001');

labelBottom=top-textHeight-spacing;
labelLeft=0.45;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_7 = uicontrol('Style','text','Position',labelPos,'Horiz','left','String','m1取值范围','BackgroundColor',[0 0 0],'ForegroundColor','white');
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_gsm1=uicontrol('Style','edit','Position',textPos,'Background','white','Foreground','black','string','[-10,10]','enable','off');

labelBottom=top-2*textHeight-2*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_8 = uicontrol('Style','text','Position',labelPos,'Horiz','left','String','m2取值范围','BackgroundColor',[0 0 0],'ForegroundColor','white');
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_gsm2=uicontrol('Style','edit','Position',textPos,'Background','white','Foreground','black','string','[-10,10]','enable','off');

labelBottom=top-3*textHeight-3*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_9 = uicontrol('Style','text','Position',labelPos,'Horiz','left','String','m3取值范围','BackgroundColor',[0 0 0],'ForegroundColor','white');
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_gsm3=uicontrol('Style','edit','Position',textPos,'Background','white','Foreground','black','string','[-10,10]','enable','off');

labelBottom=top-4*textHeight-4*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_10 = uicontrol('Style','text','Position',labelPos,'Horiz','left','String','n1取值范围','BackgroundColor',[0 0 0],'ForegroundColor','white');
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_gsn1=uicontrol('Style','edit','Position',textPos,'Background','white','Foreground','black','string','[-10,10]','enable','off');

labelBottom=top-5*textHeight-5*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_11 = uicontrol('Style','text','Position',labelPos,'Horiz','left','String','n2取值范围','BackgroundColor',[0 0 0],'ForegroundColor','white');
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_gsn2=uicontrol('Style','edit','Position',textPos,'Background','white','Foreground','black','string','[-10,10]','enable','off');

labelBottom=top-6*textHeight-6*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_12 = uicontrol('Style','text','Position',labelPos,'Horiz','left','String','n3取值范围','BackgroundColor',[0 0 0],'ForegroundColor','white');
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_gsn3=uicontrol('Style','edit','Position',textPos,'Background','white','Foreground','black','string','[-10,10]','enable','off');

labelBottom=top-7*textHeight-7*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_13 = uicontrol('Style','text','Position',labelPos,'Horiz','left','String','滞后周期取值范围','BackgroundColor',[0 0 0],'ForegroundColor','white');
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_gszh=uicontrol('Style','edit','Position',textPos,'Background','white','Foreground','black','string','[0,10]','enable','off');

labelBottom=top-9*textHeight-9*spacing;
labelPos = [labelLeft labelBottom labelWidth textHeight];
t_14 = uicontrol('Style','text','Position',labelPos,'Horiz','left','String','系统输出样本文件','BackgroundColor',[0 0 0],'ForegroundColor','white');
textPos = [labelLeft+labelWidth labelBottom textWidth textHeight];
e_out=uicontrol('Style','edit','Position',textPos,'Background','white','Foreground','black','string',pwd);
b_3out=uicontrol(gcf,'style','push','unit','normalized',...
    'position',[labelLeft+labelWidth labelBottom-0.05 textWidth textHeight],'string','提交样本');
set(b_3out,'callback',[...
        'fpath=get(e_out,''string'');',...
        'fout=fopen(fpath,''r'');',...
        'rout=str2num(char(fread(fout))'');',...
        'set(b_1ok,''enable'',''on'');',...
        'fclose(fout);',...
    ]);
b_1ok=uicontrol(gcf,'style','push','unit','normalized',...
    'position',[0.4,0.04,0.1,0.05],'string','确定参数','enable','off');
set(b_1ok,'callback',[...        
        'pmutate=str2num(get(e_pmutation,''string''));',...
        'pcross=str2num(get(e_pcross,''string''));',...
        'maxgen=str2num(get(e_maxgen,''string''));',...
        'lchrom=str2num(get(e_lchrom,''string''));',...
        'popsize=str2num(get(e_popsize,''string''));',...
        'ts=str2num(get(e_ts,''string''));'...
        'settinginput;',...
        'delete(b_1ok,b_3out,e_rin,e_ts,r_order1,r_order2,r_order3);',...
        'delete(e_pmutation,e_pcross,e_maxgen,e_lchrom,e_popsize);',...
        'delete(e_gsm1,e_gsm2,e_gsm3,e_gsn1,e_gsn2,e_gsn3,e_gszh,e_out);',...
        'delete(t_1,t_2,t_3,t_4,t_5,t_6,t_7,t_8,t_9,t_10,t_11,t_12,t_13,t_14,t_rin,f_2,f_3,f_4);',...
        'delete(r_jyin,r_xpin,r_zdyin,gca);'...
        'eval(strsysiden)',...
    ]);
b_2back=uicontrol(gcf,'style','push','unit','normalized',...
    'position',[0.55,0.04,0.1,0.05],'string','返回');
set(b_2back,'callback','gaop');
set(b_2back,'background','green');
set(b_1ok,'background','green');

⌨️ 快捷键说明

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