Code covered by the BSD License  

Highlights from
MIMOtool

image thumbnail

MIMOtool

by

 

12 Nov 2001 (Updated )

Multi Input Multi Output Systems Toolbox

viewform(tipo)
function viewform(tipo)
%VIEW MATRICES of the selected form
%
%   viewform(tipo)
%
% Massimo Davini 24/05/99 --- revised 30/09/99

% put delgraf instead of delete(findobj('tag','grafico'));
% 25/may/02 Giampy

global stack;

%---------------------inizializzazione--------------------------
delgraf;
delete(findobj('tag','matrice'));
set(findobj('tag','ana0'),'visible','off');
set(findobj('tag','file_7'),'enable','off');

if isfield(stack.temp,'handles')&(~isempty(stack.temp.handles))
   delete(stack.temp.handles);
end;
drawnow;

stack.temp=[];stack.temp.handles=[];
%---------------------------------------------------------------

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

set(findobj('tag','file_7'),'enable','on');

set(gcf,'Name',sprintf(' MIMO Tool : ANALYSIS %s --> %s',stack.general.model,tipo));

vf(1)=uicontrol('style','push',...
   'unit','normalized','position',[0.05 0.05 0.14 0.12],...
   'fontunits','normalized','fontsize',0.35,'fontweight','bold',...
   'string','BACK','Horizontalalignment','center','tag','back',...
   'TooltipString','Back to the main ANALYSIS window');

vf(2)=uicontrol('backgroundcolor',[1 1 1],...
   'style','frame','Visible','on','tag','FA',...
   'units','normalized','position',[.037 .833 .106 .11]);

vf(3)=uicontrol('style','push',...
   'unit','normalized','position',[0.05 0.85 0.08 0.08],...
   'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
   'Horizontalalignment','center','visible','off','tag','A');

vf(4)=uicontrol('backgroundcolor',[1 1 1],...
   'style','frame','Visible','off','tag','FB',...
   'units','normalized','position',[0.167 0.833 0.106 0.11]);

vf(5)=uicontrol('style','push',...
   'unit','normalized','position',[0.18 0.85 0.08 0.08],...
   'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
   'Horizontalalignment','center','visible','off','tag','B');

vf(6)=uicontrol('backgroundcolor',[1 1 1],...
  'style','frame','Visible','off','tag','FC',...
  'units','normalized','position',[0.297 0.833 0.106 0.11]);

vf(7)=uicontrol('style','push',...
   'unit','normalized','position',[0.31 0.85 0.08 0.08],...
   'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
   'Horizontalalignment','center','visible','off','tag','C');

vf(8)=uicontrol('backgroundcolor',[1 1 1],...
  'style','frame','Visible','off','tag','FD',...
  'units','normalized','position',[0.427 0.833 0.106 0.11]);

vf(9)=uicontrol('style','push',...
   'unit','normalized','position',[0.44 0.85 0.08 0.08],...
   'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
   'Horizontalalignment','center','visible','off','tag','D');

vf(10)=uicontrol('backgroundcolor',[1 1 1],...
  'style','frame','Visible','off','tag','FT',...
  'units','normalized','position',[0.557 0.833 0.106 0.11]);

vf(11)=uicontrol('style','push',...
   'unit','normalized','position',[0.57 0.85 0.08 0.08],...
   'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
   'Horizontalalignment','center','visible','off','tag','T');

stack.temp.handles=vf;

ist1='set(findobj(''tag'',''FA''),''visible'',''off'');';
ist2='set(findobj(''tag'',''FB''),''visible'',''off'');';
ist3='set(findobj(''tag'',''FC''),''visible'',''off'');';
ist4='set(findobj(''tag'',''FD''),''visible'',''off'');';
ist5='set(findobj(''tag'',''FT''),''visible'',''off'');';
callb=[ist1,ist2,ist3,ist4,ist5];

switch tipo
case 'System Matrices'
   
  set(vf(3),'string','A','visible','on',...
    'callback',[callb,'set(findobj(''tag'',''FA''),''visible'',''on'');',...
     'set(gcf,''userdata'',[{''A''},{''sy''},{stack.general.A}]);',...
      'visual(stack.general.A,''A'');']);

  set(vf(5),'string','B','visible','on',...
    'callback',[callb,'set(findobj(''tag'',''FB''),''visible'',''on'');',...
       'set(gcf,''userdata'',[{''B''},{''sy''},{stack.general.B}]);',...
         'visual(stack.general.B,''B'');']);

  set(vf(7),'string','C','visible','on',...
    'callback',[callb,'set(findobj(''tag'',''FC''),''visible'',''on'');',...
       'set(gcf,''userdata'',[{''C''},{''sy''},{stack.general.C}]);',...
         'visual(stack.general.C,''C'');']);

  set(vf(9),'string','D','visible','on',...
    'callback',[callb,'set(findobj(''tag'',''FD''),''visible'',''on'');',...
       'set(gcf,''userdata'',[{''D''},{''sy''},{stack.general.D}]);',...
         'visual(stack.general.D,''D'');']);

   set(vf(1),'callback','back_ana(''ana0'',[]);')
   set(vf(2),'visible','on');
   set(gcf,'userdata',[{'A'},{'sy'},{stack.general.A}]);
   visual(stack.general.A,'A'); 

   
case 'Controllability Form'
   
   Testo(1)=uicontrol('style','frame',...
      'units','normalized','position',[0.65 0.115 0.3 0.055],...
      'backgroundcolor',[1 1 1],'tag','testo');
   
   Testo(2)=uicontrol('style','text',...
      'units','normalized','position',[0.67 0.13 0.05 0.025],...
      'backgroundcolor',[1 0 0],'tag','testo');
       
   Testo(3)=uicontrol('style','text',...
      'units','normalized','position',[0.73 0.12 0.21 0.045],...
      'fontunits','normalized','fontsize',jsz+0.7,'fontweight','bold',...
      'string','Controllable','backgroundcolor',[1 1 1],...
      'tag','testo');
      
   Testo(4)=uicontrol('style','frame',...
      'units','normalized','position',[0.65 0.05 0.3 0.055],...
      'backgroundcolor',[1 1 1],'tag','testo');
   
   Testo(5)=uicontrol('style','text',...
      'units','normalized','position',[0.67 0.065 0.05 0.025],...
      'backgroundcolor',[.5 .5 .5],'tag','testo');
   
   Testo(6)=uicontrol('style','text',...
      'units','normalized','position',[0.73 0.055 0.21 0.045],...
      'fontunits','normalized','fontsize',jsz+0.7,'fontweight','bold',...
      'string',' not Controllable','backgroundcolor',[1 1 1],...
      'tag','testo');
 
   stack.temp.handles=[stack.temp.handles,Testo];   
   set(vf(1),'callback',[...
      'back_ana(''ana0'',[],''Ac'',''Bc'',''Cc'',''Dc'',''Tc'');'])
   
   rangocon=rank(ctrb(stack.general.A,stack.general.B));
   
   iston=['set(findobj(''tag'',''testo''),''visible'',''on'');'];
   istoff=['set(findobj(''tag'',''testo''),''visible'',''off'');'];

   set(vf(3),'string','Ac','visible','on',...
    'callback',[...
      callb,iston,...
      'set(findobj(''tag'',''FA''),''visible'',''on'');',...
      'set(gcf,''userdata'',[{''A''},{''co''},{stack.temp.Ac}]);',...
      sprintf('visual(stack.temp.Ac,''Ac'','''',''ctrb'',%u);',rangocon)]);

   set(vf(5),'string','Bc','visible','on',...
    'callback',[...
      callb,iston,...
      'set(findobj(''tag'',''FB''),''visible'',''on'');',...
      'set(gcf,''userdata'',[{''B''},{''co''},{stack.temp.Bc}]);',...
       sprintf('visual(stack.temp.Bc,''Bc'','''',''ctrb'',%u);',rangocon)]);

   set(vf(7),'string','Cc','visible','on',...
    'callback',[...
      callb,iston,...
      'set(findobj(''tag'',''FC''),''visible'',''on'');',...
      'set(gcf,''userdata'',[{''C''},{''co''},{stack.temp.Cc}]);',...
      sprintf('visual(stack.temp.Cc,''Cc'','''',''ctrb'',%u);',rangocon)]);

   set(vf(9),'string','Dc','visible','on',...
    'callback',[...
      callb,istoff,...
      'set(findobj(''tag'',''FD''),''visible'',''on'');'...
      'set(gcf,''userdata'',[{''D''},{''co''},{stack.temp.Dc}]);',...
      'visual(stack.temp.Dc,''Dc'');']);

   set(vf(11),'string','Tc','visible','on',...
    'callback',[...
      callb,istoff,...
      'set(findobj(''tag'',''FT''),''visible'',''on'');'...
      'set(gcf,''userdata'',[{''T''},{''co''},{stack.temp.Tc}]);',...
      'visual(stack.temp.Tc,''Tc'');']);

   [Ac,Bc,Cc,Tc,K]=ctrbf(stack.general.A,stack.general.B,stack.general.C);
   Dc=stack.general.D;
   
   stack.temp.Ac=Ac;stack.temp.Bc=Bc;
   stack.temp.Cc=Cc;stack.temp.Dc=Dc;
   stack.temp.Tc=Tc;

   set(vf(2),'visible','on');
   set(gcf,'userdata',[{'A'},{'co'},{stack.temp.Ac}]);
   visual(stack.temp.Ac,'Ac','','ctrb',rangocon); 

   
case 'Observability Form'
   
   Testo(1)=uicontrol('style','frame',...
      'units','normalized','position',[0.65 0.115 0.3 0.055],...
      'backgroundcolor',[1 1 1],'tag','testo');
   
   Testo(2)=uicontrol('style','text',...
      'units','normalized','position',[0.67 0.13 0.05 0.025],...
      'backgroundcolor',[1 0 0],'tag','testo');
       
   Testo(3)=uicontrol('style','text',...
      'units','normalized','position',[0.73 0.12 0.21 0.045],...
      'fontunits','normalized','fontsize',jsz+0.7,'fontweight','bold',...
      'string','Observable','backgroundcolor',[1 1 1],'tag','testo');
   
   Testo(4)=uicontrol('style','frame',...
      'units','normalized','position',[0.65 0.05 0.3 0.055],...
      'backgroundcolor',[1 1 1],'tag','testo');
   
   Testo(5)=uicontrol('style','text',...
      'units','normalized','position',[0.67 0.065 0.05 0.025],...
      'backgroundcolor',[.5 .5 .5],'tag','testo');
   
   Testo(6)=uicontrol('style','text',...
      'units','normalized','position',[0.73 0.055 0.21 0.045],...
      'fontunits','normalized','fontsize',jsz+0.7,'fontweight','bold',...
      'string',' not Observable','backgroundcolor',[1 1 1],...
      'tag','testo');

   stack.temp.handles=[stack.temp.handles,Testo];   
   set(vf(1),'callback','back_ana(''ana0'',[],''Ao'',''Bo'',''Co'',''Do'',''To'');')
   
   rangoobs=rank(obsv(stack.general.A,stack.general.C));
   
   iston=['set(findobj(''tag'',''testo''),''visible'',''on'');'];
   istoff=['set(findobj(''tag'',''testo''),''visible'',''off'');'];

   set(vf(3),'string','Ao','visible','on',...
      'callback',[callb,iston,'set(findobj(''tag'',''FA''),''visible'',''on'');',...
       'set(gcf,''userdata'',[{''A''},{''ob''},{stack.temp.Ao}]);',...
        sprintf('visual(stack.temp.Ao,''Ao'','''',''obsv'',%u);',rangoobs)]);
   set(vf(5),'string','Bo','visible','on',...
      'callback',[callb,iston,'set(findobj(''tag'',''FB''),''visible'',''on'');',...
       'set(gcf,''userdata'',[{''B''},{''ob''},{stack.temp.Bo}]);',...
        sprintf('visual(stack.temp.Bo,''Bo'','''',''obsv'',%u);',rangoobs)]);
   set(vf(7),'string','Co','visible','on',...
      'callback',[callb,iston,'set(findobj(''tag'',''FC''),''visible'',''on'');',...
        'set(gcf,''userdata'',[{''C''},{''ob''},{stack.temp.Co}]);',...         
         sprintf('visual(stack.temp.Co,''Co'','''',''obsv'',%u);',rangoobs)]);
   set(vf(9),'string','Do','visible','on',...
      'callback',[callb,istoff,'set(findobj(''tag'',''FD''),''visible'',''on'');',...         
        'set(gcf,''userdata'',[{''D''},{''ob''},{stack.temp.Do}]);',...
        'visual(stack.temp.Do,''Do'');']);
   set(vf(11),'string','To','visible','on',...
      'callback',[callb,istoff,'set(findobj(''tag'',''FT''),''visible'',''on'');',...
         'set(gcf,''userdata'',[{''T''},{''ob''},{stack.temp.To}]);',...
         'visual(stack.temp.To,''To'');']);

   [Ao,Bo,Co,To,K]=obsvf(stack.general.A,stack.general.B,stack.general.C);
   Do=stack.general.D;
   
   stack.temp.Ao=Ao;stack.temp.Bo=Bo;
   stack.temp.Co=Co;stack.temp.Do=Do;
   stack.temp.To=To;

   set(vf(2),'visible','on');
   set(gcf,'userdata',[{'A'},{'ob'},{stack.temp.Ao}]);
   visual(stack.temp.Ao,'Ao','','obsv',rangoobs); 

   
case 'Modal Form'
   
   set(vf(1),'callback','back_ana(''ana0'',[],''Am'',''Bm'',''Cm'',''Dm'',''Tm'');')
   
   set(vf(3),'string','Am','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''A''},{''mo''},{stack.temp.Am}]);',...
      'set(findobj(''tag'',''FA''),''visible'',''on'');visual(stack.temp.Am,''Am'');']);
   set(vf(5),'string','Bm','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''B''},{''mo''},{stack.temp.Bm}]);',...
      'set(findobj(''tag'',''FB''),''visible'',''on'');visual(stack.temp.Bm,''Bm'');']);
   set(vf(7),'string','Cm','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''C''},{''mo''},{stack.temp.Cm}]);',...
      'set(findobj(''tag'',''FC''),''visible'',''on'');visual(stack.temp.Cm,''Cm'');']);
   set(vf(9),'string','Dm','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''D''},{''mo''},{stack.temp.Dm}]);',...
      'set(findobj(''tag'',''FD''),''visible'',''on'');visual(stack.temp.Dm,''Dm'');']);
   set(vf(11),'string','Tm','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''T''},{''mo''},{stack.temp.Tm}]);',...
      'set(findobj(''tag'',''FT''),''visible'',''on'');visual(stack.temp.Tm,''Tm'');']);

   [Am Bm Cm Dm Tm]=canon(stack.general.A,stack.general.B,stack.general.C,stack.general.D,'modal');
   
   stack.temp.Am=Am;stack.temp.Bm=Bm;
   stack.temp.Cm=Cm;stack.temp.Dm=Dm;
   stack.temp.Tm=Tm;
   
   set(vf(2),'visible','on');
   set(gcf,'userdata',[{'A'},{'mo'},{stack.temp.Am}]);
   visual(stack.temp.Am,'Am'); 

   
case 'Companion Form'
   
   set(vf(1),'callback','back_ana(''ana0'',[],''Acom'',''Bcom'',''Ccom'',''Dcom'',''Tcom'');')
   
   set(vf(3),'string','Acom','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''A''},{''cf''},{stack.temp.Acom}]);',...
      'set(findobj(''tag'',''FA''),''visible'',''on'');visual(stack.temp.Acom,''Acom'');']);
   set(vf(5),'string','Bcom','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''B''},{''cf''},{stack.temp.Bcom}]);',...
      'set(findobj(''tag'',''FB''),''visible'',''on'');visual(stack.temp.Bcom,''Bcom'');']);
   set(vf(7),'string','Ccom','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''C''},{''cf''},{stack.temp.Ccom}]);',...
      'set(findobj(''tag'',''FC''),''visible'',''on'');visual(stack.temp.Ccom,''Ccom'');']);
   set(vf(9),'string','Dcom','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''D''},{''cf''},{stack.temp.Dcom}]);',...
      'set(findobj(''tag'',''FD''),''visible'',''on'');visual(stack.temp.Dcom,''Dcom'');']);
   set(vf(11),'string','Tcom','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''T''},{''cf''},{stack.temp.Tcom}]);',...
      'set(findobj(''tag'',''FT''),''visible'',''on'');visual(stack.temp.Tcom,''Tcom'');']);

   [Acom Bcom Ccom Dcom Tcom]=canon(stack.general.A,stack.general.B,stack.general.C,stack.general.D,'companion');
   
   stack.temp.Acom=Acom;stack.temp.Bcom=Bcom;
   stack.temp.Ccom=Ccom;stack.temp.Dcom=Dcom;
   stack.temp.Tcom=Tcom;
   
   set(vf(2),'visible','on');
   set(gcf,'userdata',[{'A'},{'cf'},{stack.temp.Acom}]);
   visual(stack.temp.Acom,'Acom'); 
   
case 'Jordan Form'
   set(vf(1),'callback','back_ana(''ana0'',[],''Aj'',''Bj'',''Cj'',''Dj'',''Tj'');')

   set(vf(3),'string','Aj','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''A''},{''jf''},{stack.temp.Aj}]);',...
      'set(findobj(''tag'',''FA''),''visible'',''on'');visual(stack.temp.Aj,''Aj'');']);
   set(vf(5),'string','Bj','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''B''},{''jf''},{stack.temp.Bj}]);',...
      'set(findobj(''tag'',''FB''),''visible'',''on'');visual(stack.temp.Bj,''Bj'');']);
   set(vf(7),'string','Cj','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''C''},{''jf''},{stack.temp.Cj}]);',...
      'set(findobj(''tag'',''FC''),''visible'',''on'');visual(stack.temp.Cj,''Cj'');']);
   set(vf(9),'string','Dj','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''D''},{''jf''},{stack.temp.Dj}]);',...
      'set(findobj(''tag'',''FD''),''visible'',''on'');visual(stack.temp.Dj,''Dj'');']);
   set(vf(11),'string','Tj','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''T''},{''jf''},{stack.temp.Tj}]);',...
      'set(findobj(''tag'',''FT''),''visible'',''on'');visual(stack.temp.Tj,''Tj'');']);

   s0=pck(stack.general.A,stack.general.B,stack.general.C,stack.general.D);
   [s1,Tj]=sys2sys(s0,'j');
   
   [Aj Bj Cj Dj]=ss2ss(stack.general.A,stack.general.B,stack.general.C,stack.general.D,inv(Tj));
   Aj=1e-4*round(1e4*Aj);
   Bj=1e-4*round(1e4*Bj);
   Cj=1e-4*round(1e4*Cj);
   Dj=1e-4*round(1e4*Dj);
   
   stack.temp.Aj=Aj;stack.temp.Bj=Bj;
   stack.temp.Cj=Cj;stack.temp.Dj=Dj;
   stack.temp.Tj=Tj;
   
   set(vf(2),'visible','on');
   set(gcf,'userdata',[{'A'},{'jf'},{stack.temp.Aj}]);
   visual(stack.temp.Aj,'Aj');
   
case 'Kalman Form'
   
   Testo(1)=uicontrol('style','frame',...
      'units','normalized','position',[0.34 0.115 0.3 0.055],...
      'backgroundcolor',[1 1 1],'tag','testo');
   Testo(2)=uicontrol('style','text',...
      'units','normalized','position',[0.36 0.13 0.05 0.025],...
      'backgroundcolor',[1 0 0],'tag','testo');
   Testo(3)=uicontrol('style','text',...
      'units','normalized','position',[0.42 0.12 0.21 0.045],...
      'fontunits','normalized','fontsize',jsz+0.7,'fontweight','bold',...
      'string','Ctrb & Obs','backgroundcolor',[1 1 1],'tag','testo');
   Testo(4)=uicontrol('style','frame',...
      'units','normalized','position',[0.34 0.05 0.3 0.055],...
      'backgroundcolor',[1 1 1],'tag','testo');
   Testo(5)=uicontrol('style','text',...
      'units','normalized','position',[0.36 0.065 0.05 0.025],...
      'backgroundcolor',[0 0 1],'tag','testo');
   Testo(6)=uicontrol('style','text',...
      'units','normalized','position',[0.415 0.055 0.22 0.045],...
      'fontunits','normalized','fontsize',jsz+0.7,'fontweight','bold',...
      'string','no Ctrb & no Obs','backgroundcolor',[1 1 1],...
      'tag','testo');
      
   Testo(7)=uicontrol('style','frame',...
      'units','normalized','position',[0.65 0.115 0.3 0.055],...
      'backgroundcolor',[1 1 1],'tag','testo');
   Testo(8)=uicontrol('style','text',...
      'units','normalized','position',[0.67 0.13 0.05 0.025],...
      'backgroundcolor',[0 1 0],'tag','testo');
   Testo(9)=uicontrol('style','text',...
      'units','normalized','position',[0.73 0.12 0.21 0.045],...
      'fontunits','normalized','fontsize',jsz+0.7,'fontweight','bold',...
      'string','Ctrb & no Obs','backgroundcolor',[1 1 1],'tag','testo');
   Testo(10)=uicontrol('style','frame',...
      'units','normalized','position',[0.65 0.05 0.3 0.055],...
      'backgroundcolor',[1 1 1],'tag','testo');
   Testo(11)=uicontrol('style','text',...
      'units','normalized','position',[0.67 0.065 0.05 0.025],...
      'backgroundcolor',[1 0 1],'tag','testo');
   Testo(12)=uicontrol('style','text',...
      'units','normalized','position',[0.73 0.055 0.21 0.045],...
      'fontunits','normalized','fontsize',jsz+0.7,'fontweight','bold',...
      'string','Obs & no Ctrb','backgroundcolor',[1 1 1],...
      'tag','testo');
      
   stack.temp.handles=[stack.temp.handles,Testo];   
   set(vf(1),'callback','back_ana(''ana0'',[],''Ak'',''Bk'',''Ck'',''Dk'',''Tk'');')
 
   s0=pck(stack.general.A,stack.general.B,stack.general.C,stack.general.D);
   [s1,Tk,dim]=sys2sys(s0,'k');
   [Ak Bk Ck Dk]=unpck(s1);
   
   iston=['set(findobj(''tag'',''testo''),''visible'',''on'');'];
   istoff=['set(findobj(''tag'',''testo''),''visible'',''off'');'];
   
   set(vf(3),'string','Ak','visible','on',...
      'callback',[callb,iston,'set(findobj(''tag'',''FA''),''visible'',''on'');',...
        'set(gcf,''userdata'',[{''A''},{''kf''},{stack.temp.Ak}]);',...
         sprintf('visual(stack.temp.Ak,''Ak'','''',''kalman'',[%u,%u,%u,%u]);',dim(1),dim(2),dim(3),dim(4))]);
   set(vf(5),'string','Bk','visible','on',...
      'callback',[callb,iston,'set(findobj(''tag'',''FB''),''visible'',''on'');',...
       'set(gcf,''userdata'',[{''B''},{''kf''},{stack.temp.Bk}]);',...
        sprintf('visual(stack.temp.Bk,''Bk'','''',''kalman'',[%u,%u,%u,%u]);',dim(1),dim(2),dim(3),dim(4))]);
   set(vf(7),'string','Ck','visible','on',...
      'callback',[callb,iston,'set(findobj(''tag'',''FC''),''visible'',''on'');',...
        'set(gcf,''userdata'',[{''C''},{''kf''},{stack.temp.Ck}]);',...         
         sprintf('visual(stack.temp.Ck,''Ck'','''',''kalman'',[%u,%u,%u,%u]);',dim(1),dim(2),dim(3),dim(4))]);
   set(vf(9),'string','Dk','visible','on',...
      'callback',[callb,istoff,'set(gcf,''userdata'',[{''D''},{''kf''},{stack.temp.Dk}]);',...
      'set(findobj(''tag'',''FD''),''visible'',''on'');visual(stack.temp.Dk,''Dk'');']);
   set(vf(11),'string','Tk','visible','on',...
      'callback',[callb,istoff,'set(gcf,''userdata'',[{''T''},{''kf''},{stack.temp.Tk}]);',...
      'set(findobj(''tag'',''FT''),''visible'',''on'');visual(stack.temp.Tk,''Tk'');']);

   stack.temp.Ak=Ak;stack.temp.Bk=Bk;
   stack.temp.Ck=Ck;stack.temp.Dk=Dk;
   stack.temp.Tk=Tk;
   
   set(vf(2),'visible','on');
   set(gcf,'userdata',[{'A'},{'kf'},{stack.temp.Ak}]);
   visual(stack.temp.Ak,'Ak','','kalman',dim); 
   
case 'Balanced Realization'
   
   set(vf(1),'callback','back_ana(''ana0'',[],''Abal'',''Bbal'',''Cbal'',''Dbal'',''Tbal'');')
   
   set(vf(3),'string','Abal','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''A''},{''ba''},{stack.temp.Abal}]);',...
      'set(findobj(''tag'',''FA''),''visible'',''on'');visual(stack.temp.Abal,''Abal'');']);
   set(vf(5),'string','Bbal','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''B''},{''ba''},{stack.temp.Bbal}]);',...
      'set(findobj(''tag'',''FB''),''visible'',''on'');visual(stack.temp.Bbal,''Bbal'');']);
   set(vf(7),'string','Cbal','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''C''},{''ba''},{stack.temp.Cbal}]);',...
      'set(findobj(''tag'',''FC''),''visible'',''on'');visual(stack.temp.Cbal,''Cbal'');']);
   set(vf(9),'string','Dbal','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''D''},{''ba''},{stack.temp.Dbal}]);',...
      'set(findobj(''tag'',''FD''),''visible'',''on'');visual(stack.temp.Dbal,''Dbal'');']);
   set(vf(11),'string','Tbal','visible','off',...
      'callback',[callb,'set(gcf,''userdata'',[{''t''},{''ba''},{stack.temp.Tbal}]);',...
      'set(findobj(''tag'',''FT''),''visible'',''on'');visual(stack.temp.Tbal,''Tbal'');']);
   
   s0=pck(stack.general.A,stack.general.B,stack.general.C,stack.general.D);
   [s1,Tbal,dim]=sys2sys(s0,'b');
   [Abal Bbal Cbal Dbal]=unpck(s1);
 
   stack.temp.Abal=Abal;stack.temp.Bbal=Bbal;
   stack.temp.Cbal=Cbal;stack.temp.Dbal=Dbal;
   stack.temp.Tbal=Tbal;
   
   set(vf(2),'visible','on');
   set(gcf,'userdata',[{'A'},{'ba'},{stack.temp.Abal}]);
   visual(stack.temp.Abal,'Abal'); 
    
case 'Brunowsky Form'
   
   set(vf(1),'callback','back_ana(''ana0'',[],''Abru'',''Bbru'',''Cbru'',''Dbru'',''Tbru'');')
   
   set(vf(3),'string','Abru','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''A''},{''br''},{stack.temp.Abru}]);',...
      'set(findobj(''tag'',''FA''),''visible'',''on'');visual(stack.temp.Abru,''Abru'');']);
   set(vf(5),'string','Bbru','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''B''},{''br''},{stack.temp.Bbru}]);',...
      'set(findobj(''tag'',''FB''),''visible'',''on'');visual(stack.temp.Bbru,''Bbru'');']);
   set(vf(7),'string','Cbru','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''C''},{''br''},{stack.temp.Cbru}]);',...
      'set(findobj(''tag'',''FC''),''visible'',''on'');visual(stack.temp.Cbru,''Cbru'');']);
   set(vf(9),'string','Dbru','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''D''},{''br''},{stack.temp.Dbru}]);',...
      'set(findobj(''tag'',''FD''),''visible'',''on'');visual(stack.temp.Dbru,''Dbru'');']);
   set(vf(11),'string','Tbru','visible','on',...
      'callback',[callb,'set(gcf,''userdata'',[{''T''},{''br''},{stack.temp.Tbru}]);',...
      'set(findobj(''tag'',''FT''),''visible'',''on'');visual(stack.temp.Tbru,''Tbru'');']);
   
   G=pck(stack.general.A,stack.general.B,stack.general.C,stack.general.D);
   [K Kf P ro Tx]=stdc(G,0);
   [rig col]=size(Tx);
   Abru=Tx*stack.general.A*inv(Tx);
   Cbru=stack.general.C*inv(Tx);
   Bbru=Tx*stack.general.B;
   Dbru=stack.general.D;

   stack.temp.Abru=Abru;stack.temp.Bbru=Bbru;
   stack.temp.Cbru=Cbru;stack.temp.Dbru=Dbru;
   stack.temp.Tbru=Tx;
   
   set(vf(2),'visible','on');
   set(gcf,'userdata',[{'A'},{'br'},{stack.temp.Abru}]);
   visual(stack.temp.Abru,'Abru'); 
end;
   

Contact us