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

📄 show2dfdiag.m

📁 内模控制器(IMC)工具箱。包括参数整定、PID控制器参数转换等
💻 M
字号:
function [diag_handle]=show2dfdiag(fig_handle,maxrow,maxcol,pnummt,pdnummt,...
   mnummt,qnummt,qfnummt,d_through_p,input_delay)
% This function will show 2-degree of freedom IMC diagram 
% and user interface on the figer.

temp=maxrow*maxcol;
if d_through_p
diag_handle=zeros(1,2*temp+25);
diag_handle(2*temp+25)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[150 160 600 22],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','Two-degree of freedom IMC diagram');
diag_handle(2*temp+24)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[527 358 50 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','>  y');
diag_handle(2*temp+23)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[100 367 430 5]);
 diag_handle(2*temp+22)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[333 377 30 18],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','v +');
diag_handle(2*temp+21)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[333 430 30 20],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','d');
diag_handle(2*temp+20)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[335 384 5 40]);
diag_handle(2*temp+19)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[330 362 15 15]);
diag_handle(2*temp+18)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[485 294 18 18],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','>');
diag_handle(2*temp+17)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[484 307 18 18],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','-');
diag_handle(2*temp+16)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[258 349 40 18],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','/\ -');
diag_handle(2*temp+15)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[80 360 40 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','r');
diag_handle(2*temp+14)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[349 297 139 5]);
diag_handle(2*temp+13)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[349 297 5 71]);
diag_handle(2*temp+12)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[500 246 5 122]);
diag_handle(2*temp+11)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[495 292 15 15]);
diag_handle(2*temp+10)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[260 246 241 5]);
diag_handle(2*temp+9)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[260 250 5 102]);
diag_handle(2*temp+8)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[255 362 15 15]);
diag_handle(2*temp+7)=uicontrol(fig_handle,...
  'Style','push',...
  'Position',[285 355 35 30],...
  'String','Sat',...
  'Callback','IMENU=2600;imcmenu;');
diag_handle(2*temp+6)=uicontrol(fig_handle,...
  'Style','text',...
  'Position',[150 330 80 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',13,...
 'HorizontalAlignment','center',...
  'String','q(er)');
diag_handle(2*temp+5)=uicontrol(fig_handle,...
  'Style','text',...
  'Position',[285 208 80 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',13,...
 'HorizontalAlignment','center',...
  'String','qqd(e)');
diag_handle(2*temp+4)=uicontrol(fig_handle,...
  'Style','text',...
  'Position',[380 330 80 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',13,...
 'HorizontalAlignment','center',...
  'String','Process');
diag_handle(2*temp+3)=uicontrol(fig_handle,...
  'Style','text',...
  'Position',[380 260 80 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',13,...
 'HorizontalAlignment','center',...
  'String','Model');
diag_handle(2*temp+1)=Xuiarray([150 350 80 40],1,1,0,0,...
   'push','p_index=1;imcmenuM;','',qnummt,2300,fig_handle);
diag_handle(2*temp+2)=Xuiarray([285 228 80 40],1,1,0,0,...
   'push','p_index=1;imcmenuM;','',qfnummt,2500,fig_handle);
diag_handle(1:temp)=Xuiarray([380 350 80 40],maxrow,maxcol,0,0,...
   'push','p_index=1;imcmenuM;','',pnummt,2100,fig_handle);
diag_handle(temp+1:2*temp)=Xuiarray([380 280 80 40],maxrow,maxcol,0,0,...
   'push','p_index=1;imcmenuM;','',mnummt,2200,fig_handle);
if maxrow > 1
diag_handle(2*temp+26)=uicontrol(fig_handle,...
  'Style','push',...
  'Position',[410 55 120 30],...
  'String','Show MSF diagram',...
  'Callback',['delete(diag_handle(ishandle(diag_handle))); [diag_handle]=showmsf2dfdiag(main_fig,maxrow,maxcol',...
     ',p,pd,m,Kspstr,d_through_p,input_delay,Kstr,Dstr,qd,prefilcal(Epsilon,order,order),Epsilon);']);
end
else
diag_handle=zeros(1,3*temp+27);
diag_handle(3*temp+27)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[150 160 600 22],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','Two-degree of freedom IMC diagram');
diag_handle(3*temp+26)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[527 358 50 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','>  y');
diag_handle(3*temp+25)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[100 367 430 5]);
 diag_handle(3*temp+24)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[473 377 30 18],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','v +');
diag_handle(3*temp+23)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[403 425 30 20],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','d');
diag_handle(3*temp+22)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[420 428 40 5]);
diag_handle(3*temp+21)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[475 384 5 35]);
diag_handle(3*temp+20)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[470 362 15 15]);
diag_handle(3*temp+19)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[485 294 18 18],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','>');
diag_handle(3*temp+18)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[484 307 18 18],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','-');
diag_handle(3*temp+17)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[258 349 40 18],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','/\ -');
diag_handle(3*temp+16)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[80 360 40 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',14,...
 'HorizontalAlignment','Left',...
 'String','r');
diag_handle(3*temp+15)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[349 297 139 5]);
diag_handle(3*temp+14)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[349 297 5 71]);
diag_handle(3*temp+13)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[500 246 5 122]);
diag_handle(3*temp+12)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[495 292 15 15]);

diag_handle(3*temp+11)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[260 246 241 5]);
diag_handle(3*temp+10)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[260 250 5 102]);
diag_handle(3*temp+9)=uicontrol(fig_handle,...
  'Style','frame',...
  'Position',[255 362 15 15]);
diag_handle(3*temp+8)=uicontrol(fig_handle,...
  'Style','push',...
  'Position',[285 355 35 30],...
  'String','Sat',...
  'Callback','IMENU=2600;imcmenu;');
diag_handle(3*temp+7)=uicontrol(fig_handle,...
  'Style','text',...
  'Position',[150 330 80 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',13,...
 'HorizontalAlignment','center',...
  'String','q(er)');
diag_handle(3*temp+6)=uicontrol(fig_handle,...
  'Style','text',...
  'Position',[285 208 80 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',13,...
 'HorizontalAlignment','center',...
  'String','qqd(e)');
diag_handle(3*temp+5)=uicontrol(fig_handle,...
  'Style','text',...
  'Position',[380 330 80 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',13,...
 'HorizontalAlignment','center',...
  'String','Process');
diag_handle(3*temp+4)=uicontrol(fig_handle,...
  'Style','text',...
  'Position',[380 260 80 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',13,...
 'HorizontalAlignment','center',...
  'String','Model');
diag_handle(3*temp+3)=uicontrol(fig_handle,...
 'Style','text',...
 'Position',[510 420 60 24],...
 'Backgroundcolor','k',...
 'Foregroundcolor',[.78 .78 .78],...
 'FontSize',13,...
 'HorizontalAlignment','Left',...
 'String','Pd');
diag_handle(3*temp+1)=Xuiarray([150 350 80 40],1,1,0,0,...
   'push','p_index=1;imcmenuM;','',qnummt,2300,fig_handle);
diag_handle(3*temp+2)=Xuiarray([285 228 80 40],1,1,0,0,...
   'push','p_index=1;imcmenuM;','',qfnummt,2500,fig_handle);
diag_handle(1:temp)=Xuiarray([380 350 80 40],maxrow,maxcol,0,0,...
   'push','p_index=1;imcmenuM;','',pnummt,2100,fig_handle);
diag_handle(temp+1:2*temp)=Xuiarray([380 280 80 40],maxrow,maxcol,0,0,...
   'push','p_index=1;imcmenuM;','',mnummt,2200,fig_handle);
diag_handle(2*temp+1:3*temp)=Xuiarray([450 410 55 40],maxrow,maxcol,0,0,...
   'push','p_index=1;imcmenuM;','',pdnummt,2400,fig_handle);
if maxrow > 1
diag_handle(3*temp+28)=uicontrol(fig_handle,...
  'Style','push',...
  'Position',[410 55 120 30],...
  'String','Show MSF diagram',...
  'Callback',['delete(diag_handle(ishandle(diag_handle))); [diag_handle]=showmsf2dfdiag(main_fig,maxrow,maxcol',...
     ',p,pd,m,Kspstr,d_through_p,input_delay,Kstr,Dstr,qd,prefilcal(Epsilon,order,order),Epsilon);']);
end
end

⌨️ 快捷键说明

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