Code covered by the BSD License  

Highlights from
MIMOtool

image thumbnail

MIMOtool

by

 

12 Nov 2001 (Updated )

Multi Input Multi Output Systems Toolbox

mu1.m
function mu1
%MU1 : 2 finestra di sintesi e di ottimizzazione MU
%
%
%Massimo Davini 02/06/99

global stack;
set(stack.temp.handles,'visible','off');
drawnow;

% enlarge text iv java machine is running
jsz=stack.general.javasize;

sizetext=.7;sizetext1=jsz/7+.07;

posframe=[0.025 0.22 0.34 0.73];
posstr1=[0.035 0.4 0.32 0.54];
posstr2=[0.035 0.23 0.32 0.2];

stringa1='Insert the dimensions of the blocks for the structured uncertainty relative to the matrices:';
stringa2='Default: only one block with size equal to the size of the relative transpose matrix.';
stringa3=sprintf('you can augment the blocks but the total of rows and the total of columns must be equal to their default value.');

mu(1)=uicontrol('style','frame','units','normalized','position',posframe,...
   'backgroundcolor',[1 1 1],'tag','mu1');

mu(2)=uicontrol('style','text','units','normalized','position',posstr1,...
   'fontunits','normalized','fontsize',sizetext1*0.8,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left',...
   'string',sprintf('%s %s',stringa1,stringa3'),'tag','mu1');

mu(3)=uicontrol('style','text','units','normalized','position',posstr2,...
   'fontunits','normalized','fontsize',sizetext1*2,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'foregroundcolor','red',...
   'HorizontalAlignment','left','string',stringa2,'tag','mu1');

selezione=stack.temp.sceltamatrici;
[no,ni]=size(stack.general.D);

mat1=[];mat2=[];
switch selezione
   case {1,2}
     %structured block on To if selezione=1 
     %structured block on Mo if selezione=2 
     mu(4)=uicontrol('style','text','units','normalized',...
        'fontunits','normalized','fontsize',sizetext,'fontweight','bold',...
        'position',[0.39 0.9 0.12 0.06],'backgroundcolor',[.6 .7 .9],...
        'string','','HorizontalAlignment','right','tag','mu1');

     mu(5)=uicontrol('style','push','unit','normalized',...
        'TooltipString','Hold the current value of the matrix',...
        'fontunits','normalized','fontsize',jsz/2+.4,'fontweight','bold',...
        'position',[0.39 0.775 0.12 0.075],'Horizontalalignment','center',...
        'string','SET','tag','mu1',...
        'callback','setmat(1);');
     
     if selezione==1 
        if no<=10 lim1=no;else lim1=10;end;
     elseif selezione==2 
        lim1=min(no,ni);if lim1>10 lim1=10;end;
     end;
     
     for i=1:lim1
       mat1(i,1)=uicontrol('style','edit','units','normalized',...
          'fontunits','normalized','fontsize',jsz+.5,'fontweight','bold',...
          'position',[0.52 0.9-0.075*(i-1) 0.05 0.06],...
          'backgroundcolor',[1 1 1],'tag','mu1');

       mat1(i,2)=uicontrol('style','edit','units','normalized',...
          'fontunits','normalized','fontsize',jsz+.5,'fontweight','bold',...
          'position',[0.58 0.9-0.075*(i-1) 0.05 0.06],...
          'backgroundcolor',[1 1 1],'tag','mu1');
      end;
      set(mat1(1,1),'string',num2str(no));

      if selezione==1,  
         set(mat1(1,2),'string',num2str(no));
         set(mu(4),'string','  bTo  =');
      elseif selezione==2,
         set(mat1(1,2),'string',num2str(ni));
         set(mu(4),'string','  bMo  =');
      end;
      
      
   case {3,4}
     %structured block on Ti and To if selezione=3 
     %structured block on Mi and Mo if selezione=4
     mu(4)=uicontrol('style','text','units','normalized',...
        'fontunits','normalized','fontsize',sizetext,'fontweight','bold',...
        'position',[0.39 0.9 0.12 0.06],'backgroundcolor',[.6 .7 .9],...
        'string','','HorizontalAlignment','right','tag','mu1');

     mu(5)=uicontrol('style','push','unit','normalized',...
        'fontunits','normalized','fontsize',jsz/2+.4,'fontweight','bold',...
        'TooltipString','Hold the current value of the matrix',...
        'position',[0.39 0.775 0.12 0.075],'Horizontalalignment','center',...
        'string','SET','tag','mu1',...
        'callback','setmat(1);');

     if selezione==3 
        if ni<=10 lim1=ni;else lim1=10;end;
     elseif selezione==4
        lim1=min(ni,no);if lim1>10 lim1=10;end;
     end;

     for i=1:lim1
       mat1(i,1)=uicontrol('style','edit','units','normalized',...
          'fontunits','normalized','fontsize',jsz+.5,'fontweight','bold',...
          'position',[0.52 0.9-0.075*(i-1) 0.05 0.06],...
          'backgroundcolor',[1 1 1],'tag','mu1');

       mat1(i,2)=uicontrol('style','edit','units','normalized',...
          'fontunits','normalized','fontsize',jsz+.5,'fontweight','bold',...
          'position',[0.58 0.9-0.075*(i-1) 0.05 0.06],...
          'backgroundcolor',[1 1 1],'tag','mu1');
     end;
     
     set(mat1(1,1),'string',num2str(ni));
     if selezione==3,  
         set(mat1(1,2),'string',num2str(ni));
         set(mu(4),'string','  bTi  =');
      elseif selezione==4,
         set(mat1(1,2),'string',num2str(no));
         set(mu(4),'string','  bMi  =');
      end;

     mu(6)=uicontrol('style','text','units','normalized',...
        'fontunits','normalized','fontsize',sizetext,'fontweight','bold',...
        'position',[0.7 0.9 0.12 0.06],'backgroundcolor',[.6 .7 .9],...
        'string','','HorizontalAlignment','right','tag','mu1');

     mu(7)=uicontrol('style','push','unit','normalized',...
        'TooltipString','Hold the current value of the matrix',...
        'fontunits','normalized','fontsize',jsz/2+.4,'fontweight','bold',...
        'position',[0.7 0.775 0.12 0.075],'Horizontalalignment','center',...
        'string','SET','tag','mu1',...
        'callback','setmat(2);');

     if selezione==3 
        if no<=10 lim2=no;else lim2=10;end;
     elseif selezione==4
        lim2=min(ni,no);if lim2>10 lim2=10;end;
     end;
     
     for i=1:lim2
       mat2(i,1)=uicontrol('style','edit','units','normalized',...
          'fontunits','normalized','fontsize',jsz+.5,'fontweight','bold',...
          'position',[0.84 0.9-0.075*(i-1) 0.05 0.06],...
          'backgroundcolor',[1 1 1],'tag','mu1');

       mat2(i,2)=uicontrol('style','edit','units','normalized',...
          'fontunits','normalized','fontsize',jsz+.5,'fontweight','bold',...
          'position',[0.9 0.9-0.075*(i-1) 0.05 0.06],...
          'backgroundcolor',[1 1 1],'tag','mu1');
     end;
     
     set(mat2(1,1),'string',num2str(no));
     if selezione==3,  
         set(mat2(1,2),'string',num2str(no));
         set(mu(6),'string','  bTo  =');
     elseif selezione==4,
         set(mat2(1,2),'string',num2str(ni));
         set(mu(6),'string','  bMo  =');
     end;
     
end;

x=length(mu);
mu(x+1)=uicontrol('style','push','unit','normalized','position',[0.05 0.05 0.14 0.12],...
   'fontunits','normalized','fontsize',.35,'fontweight','bold',...
   'string','BACK','Horizontalalignment','center','tag','mu1',...
   'TooltipString','Back to the previous window',...
   'callback',sprintf('back_syn(''mu0'',%u);',length(stack.temp.handles))); 

campi=['''integratori'',''pesi'',''sceltamatrici'',''bTo'',''bMo'',''bTi'',''bMi'',''flag'',''type'',''X1X2'',''plant'''];
mu(x+2)=uicontrol('style','push','unit','normalized','position',[0.2 0.05 0.14 0.12],...
   'fontunits','normalized','fontsize',.35,'fontweight','bold',...
   'string','CLOSE','Horizontalalignment','center',...
   'TooltipString','Back to the main SYNTHESIS window',...
   'callback',sprintf('back_syn(''syn0'',0,%s);',campi),'tag','mu1');
 
mu(x+3)=uicontrol('style','push','unit','normalized','position',[0.81 0.05 0.14 0.12],...
   'fontunits','normalized','fontsize',.35,'fontweight','bold',...
   'Horizontalalignment','center','string','NEXT','tag','BNEXT',...
   'TooltipString','Go to the next window','callback','mu2;',...
   'enable','off');

drawnow;

stack.temp.handles=[stack.temp.handles,mu];

for i=1:lim1
   stack.temp.handles=[stack.temp.handles,mat1(i,1)];
   stack.temp.handles=[stack.temp.handles,mat1(i,2)];
end;

if ~isempty(mat2)
  for i=1:lim2
     stack.temp.handles=[stack.temp.handles,mat2(i,1)];
     stack.temp.handles=[stack.temp.handles,mat2(i,2)];
  end;
end;

Contact us