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

📄 view_mimo.m

📁 Software for design and tuninig of SISO and MIMO contol systems
💻 M
字号:
%View control system setting
if degree_freedom==1
   tmp=(350+4*maxrow*25);
else
   tmp=(380+5*maxrow*25);
end
if not_save_yet
   temp=[datadir,NAMEFILE,'*]'];
else
   temp=[datadir,NAMEFILE,']'];
end
[f]=crfig(20,20,600,tmp,['MIMO System information - [',temp],'w','none','off');
uicontrol(f,...
  'Style','text',...
  'Position',[20 tmp-30 100 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',' System structure: ');
if degree_freedom==1
	fun='mimo1com';   
	uicontrol(f,...
  'Style','text',...
  'Position',[140 tmp-30 400 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','center',...
  'String',' One degree of Freedom ');
else
	fun='imc2com';   
	uicontrol(f,...
  'Style','text',...
  'Position',[140 tmp-30 400 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','center',...
  'String',' Two degree of Freedom ');
end
tmp(2)=tmp(1)-60;
uicontrol(f,...
  'Style','text',...
  'Position',[40 tmp(2) 50 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',' Process: ');
tmp(3)=tmp(2)-22*maxrow-10;
uicontrol(f,...
  'Style','text',...
  'Position',[40 tmp(3) 50 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',' Model: ');
tmp(4)=tmp(3)-22*maxrow-40;
 uicontrol(f,...
  'Style','text',...
  'Position',[20 tmp(4) 70 50],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Part of Model to be inverted:');
tmp(4)=tmp(4)+30;
tmp(5)=480/maxcol;
for i=1:maxrow
   for j=1:maxcol
      uicontrol(f,...
         'Style','edit',...
         'Position',[100+(j-1)*tmp(5) tmp(2)-22*(i-1) tmp(5)-2 20],...
         'Backgroundcolor','w',...
         'Foregroundcolor','k',...
         'String',p{i,j});
      uicontrol(f,...
         'Style','edit',...
         'Position',[100+(j-1)*tmp(5) tmp(3)-22*(i-1) tmp(5)-2 20],...
         'Backgroundcolor','w',...
         'Foregroundcolor','k',...
         'String',m{i,j});
      uicontrol(f,...
         'Style','edit',...
         'Position',[100+(j-1)*tmp(5) tmp(4)-22*(i-1) tmp(5)-2 20],...
         'Backgroundcolor','w',...
         'Foregroundcolor','k',...
         'String',q{i,j});
   end
end
tmp(6)=tmp(4)-22*maxrow-5;
uicontrol(f,...
  'Style','text',...
  'Position',[20 tmp(6) 100 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Inputs Delay time :');
uicontrol(f,...
  'Style','edit',...
  'Position',[110 tmp(6) 160 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'String',num2str(input_delay));
uicontrol(f,...
  'Style','text',...
  'Position',[285 tmp(6) 150 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Decoupling Delays Matrix :');
uicontrol(f,...
  'Style','edit',...
  'Position',[418 tmp(6) 160 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'String', num2str(dec_M));
tmp(7)=tmp(6)-27;
uicontrol(f,...
  'Style','text',...
  'Position',[20 tmp(7) 100 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Filter time constants :');
uicontrol(f,...
  'Style','edit',...
  'Position',[120 tmp(7) 230 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'String',num2str(Epsilon{1}));
uicontrol(f,...
  'Style','text',...
  'Position',[355 tmp(7) 100 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Filter Orders:');
if iscell(order)
   temp=num2str(order{1});
else
   temp=num2str(order);
end
uicontrol(f,...
  'Style','edit',...
  'Position',[418 tmp(7) 160 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'String', temp);
tmp(7)=tmp(7)-30;
if degree_freedom==2
   tmp(4)=20;
	tmp(5)=270/maxcol;
else
   tmp(4)=100;
	tmp(5)=480/maxcol;
end
uicontrol(f,...
  'Style','text',...
  'Position',[tmp(4) tmp(7) 150 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Disturbance lag process :');
tmp(7)=tmp(7)-20;
for i=1:maxrow
   for j=1:maxcol
      uicontrol(f,...
         'Style','edit',...
         'Position',[tmp(4)+(j-1)*tmp(5) tmp(7)-(i-1)*22 tmp(5)-2 20],...
         'Backgroundcolor','w',...
         'Foregroundcolor','k',...
         'String',pd{i,j});
   end
end
if degree_freedom==2
uicontrol(f,...
  'Style','text',...
  'Position',[310 tmp(7)+20 150 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Disturbance lag model :');
pd_prime_str=cell(maxrow,maxcol);
for i=1:maxrow
   pd_prime_str{i,i}=mtx2str(pd_prime{i,i},2);
   for j=1:maxcol
      uicontrol(f,...
         'Style','edit',...
         'Position',[310+(j-1)*tmp(5) tmp(7)-(i-1)*22 tmp(5)-2 20],...
         'Backgroundcolor','w',...
         'Foregroundcolor','k',...
         'String',pd_prime_str{i,j});
   end
end
tmp(7)=tmp(7)-22*(maxrow-1)-10;
uicontrol(f,...
  'Style','text',...
  'Position',[20 tmp(7)-60 90 50],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',' Feedback controller qd: ');
tmp(4)=100;
tmp(5)=480/maxcol;
for i=1:maxrow
   for j=1:maxcol
      if i<=max(size(qd)) & i==j
         if isempty(findstr(qd{i,j},'e('))
            temp=strrep(qd{i,j},'e',num2str(Epsilon{2}(j)));
         else
            temp=strrep(qd{i,j},['e(' num2str(j) ')'],num2str(Epsilon{2}(j)));
         end
      else
         temp='';
      end
      uicontrol(f,...
         'Style','edit',...
         'Position',[tmp(4)+(j-1)*tmp(5) tmp(7)-(i)*22 tmp(5)-2 20],...
         'Backgroundcolor','w',...
         'Foregroundcolor','k',...
         'String',temp);
   end
end
tmp(7)=tmp(7)-(maxrow+1)*22-10;
uicontrol(f,...
  'Style','text',...
  'Position',[20 tmp(7) 100 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Filter time constants :');
uicontrol(f,...
  'Style','edit',...
  'Position',[120 tmp(7) 230 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'String',num2str(Epsilon{2}));
uicontrol(f,...
  'Style','text',...
  'Position',[355 tmp(7) 100 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Filter Orders:');
if iscell(order)
   temp=num2str(order{1});
else
   temp=num2str(order);
end
uicontrol(f,...
  'Style','edit',...
  'Position',[418 tmp(7) 160 20],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'String', temp);
end

uicontrol(f,...
  'Style','text',...
  'Position',[65 205 200 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','left',...
  'String','Uncertainty on process parameters :');

temp_st0='';
temp_st1='';
if length(vub) ~= 0
 for k=1:length(vub)
  temp_st0=[temp_st0 num2str(vlb(k)) '  =<  x('];
  temp_st0=[temp_st0 num2str(k) ')  =<  ' num2str(vub(k))];
  temp_st1=strvcat(temp_st1,temp_st0);
  temp_st0='';
 end	
end

uicontrol(gcf,...
  'Style','edit',...
  'String',temp_st1,...
  'Position',[60 65 180 140],...
  'HorizontalAlignment','Center',...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'Max',2); 
uicontrol(f,...
  'Style','push',...
  'Position',[260 20 80 25],...
  'String','OK',...
  'Callback','close');


% View default variables
%-------------------------------------------------------------
uicontrol(f,...
  'Style','text',...
  'Position',[275 180 100 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String','Saturation bounds:');
uicontrol(f,...
  'Style','edit',...
  'Position',[375 180 80 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'String',satubs);
uicontrol(f,...
  'Style','edit',...
  'Position',[460 180 80 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'String',satlbs); 
uicontrol(f,...
  'Style','frame',...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'Position',[275 65 300 110]);

uicontrol(f,...
  'Style','text',...
  'Position',[285 150 250 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',' Noise amplification factor');
uicontrol(f,...
  'Style','text',...
  'Position',[465 150 100 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',num2str(Na));
uicontrol(f,...
  'Style','text',...
  'Position',[285 130 250 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',' Frequency Range (rad/unit time)');
temp='';
temp=[temp '1e'];
temp=[temp num2str(decade(1))];
temp=[temp ' to  1e'];
temp=[temp num2str(decade(2))];
uicontrol(f,...
  'Style','text',...
  'Position',[465 130 100 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',temp);
uicontrol(f,...
  'Style','text',...
  'Position',[285 110 250 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',' # of frequency points per decade');
uicontrol(f,...
  'Style','text',...
  'Position',[465 110 100 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',num2str(numpdec));
uicontrol(f,...
  'Style','text',...
  'Position',[285 90 250 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',' Tolerance');
uicontrol(f,...
  'Style','text',...
  'Position',[465 90 100 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',num2str(Acc));
uicontrol(f,...
  'Style','text',...
  'Position',[285 70 250 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',' Infinity');
uicontrol(f,...
  'Style','text',...
  'Position',[465 70 100 18],...
  'Backgroundcolor','w',...
  'Foregroundcolor','k',...
  'HorizontalAlignment','Left',...
  'String',num2str(inf));

clear tmp

⌨️ 快捷键说明

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