Code covered by the BSD License  

Highlights from
MIMOtool

image thumbnail

MIMOtool

by

 

12 Nov 2001 (Updated )

Multi Input Multi Output Systems Toolbox

lqs_0.m
function lqs_0;

%

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

global stack;

if stack.general.K_flag 
    messag(gcf,'kns_m',[],'lqs',4);return;
end;

%se c' un modello simulink aperto,viene chiuso 
if ~isempty(find_system('name','Closed_Loop_System'))
   close_system('Closed_Loop_System',0);
end;

%---------------inizializzazione-----------------
delete(findobj('tag','inf'));
delete(findobj('tag','eva'));
delete(findobj('tag','textgrafico'));
set(findobj('tag','syn0'),'visible','off');
delgraf;
delete(findobj('tag','matrice'));
set(findobj('tag','file_6'),'enable','off');

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

stack.temp=[];stack.temp.handles=[];
stack.evaluation=[];stack.simulation=[];

set(findobj('tag','simu_2'),'enable','off');
set(get(findobj('tag','eval_1'),'children'),'enable','off','visible','on');
%------------------------------------------------
tipo='LQ - SERVO';
set(gcf,'Name',sprintf(' MIMO Tool : SYNTHESIS %s --> %s',stack.general.model,tipo));

stack.temp.outs=zeros(size(stack.general.C,1),1);
stack.temp.outsi=zeros(size(stack.general.C,1),1);

st1=.8;

lqs0(1)=uicontrol('style','frame',...
   'units','normalized','position',[0.05 0.81 0.9 0.14],...
   'backgroundcolor',[1 1 1],'visible','off','tag','lqs0');

str=['Choose the Outputs or States ( y = C x = I x ) which',...
      ' have to be assigned and select the desired integrative',...
      ' actions upon them.'];
lqs0(2)=uicontrol('style','text',...
   'units','normalized','position',[.07 .82 .86 0.11],...
   'fontunits','normalized','fontsize',.36,...
   'fontweight','bold','visible','off',...
   'backgroundcolor',[1 1 1],'foregroundcolor','red',...
   'HorizontalAlignment','left','tag','lqs0',...
   'string',str);

lqs0(3)=uicontrol('style','frame',...
   'units','normalized','position',[0.05 0.72 0.4 0.07],...
   'backgroundcolor',[1 1 1],'visible','off','tag','lqs0');

lqs0(4)=uicontrol('style','text',...
   'units','normalized','position',[.06 .73 .38 0.05],...
   'fontunits','normalized','fontsize',st1,...
   'fontweight','bold','visible','off',...
   'backgroundcolor',[1 1 1],...
   'HorizontalAlignment','center','tag','lqs0',...
   'string','OUTPUTS or STATES');

lqs0(5)=uicontrol('style','frame',...
   'units','normalized','position',[0.55 0.72 0.4 0.07],...
   'backgroundcolor',[1 1 1],'visible','off','tag','lqs0');

lqs0(6)=uicontrol('style','text',...
   'units','normalized','position',[.56 .73 .38 0.05],...
   'fontunits','normalized','fontsize',st1,...
   'fontweight','bold','visible','off',...
   'backgroundcolor',[1 1 1],...
   'HorizontalAlignment','center','tag','lqs0',...
   'string','INTEGRATIVE ACTIONS');

n=size(stack.general.C,1);
for i=1:n
  ck(i)=uicontrol('style','checkbox','unit','normalized',...
         'fontunits','normalized','fontsize',st1-0.02,'fontweight','bold',...
         'position',[0.07+0.2*floor(i/10) 0.65-mod((i-1),9)*0.055 0.15 0.05],...
         'backgroundcolor',[.6 .7 .9],'visible','off',...
         'string',sprintf('Out%u',i),'tag',sprintf('ck_%u',i),...
         'callback',sprintf('lqs_01(%u,0);',i));
      
  cki(i)=uicontrol('style','checkbox','unit','normalized',...
         'fontunits','normalized','fontsize',st1-0.02,'fontweight','bold',...
         'position',[0.57+0.2*floor(i/10) 0.65-mod((i-1),9)*0.055 0.15 0.05],...
         'backgroundcolor',[.6 .7 .9],'enable','off','visible','off',...
         'string',sprintf('on Out%u',i),'tag',sprintf('cki_%u',i),...
         'callback',sprintf('lqs_01(%u,1);',i));
 end;


campi=['''outs'',''outsi'''];
ps(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','lqs0',...
   'TooltipString','Back to the main SYNTHESIS window',...
   'callback',sprintf('back_syn(''syn0'',0,%s);',campi));

ps(2)=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','lqs0_next',...
   'TooltipString','Go to the next window','callback','lqs_1;',...
   'enable','off');

drawnow;
set(lqs0,'visible','on');
set(ck,'visible','on');
set(cki,'visible','on');
drawnow;

%aggiornamento handles temporanei
stack.temp.handles=[stack.temp.handles,lqs0,ck,cki,ps];

Contact us