Code covered by the BSD License  

Highlights from
MIMOtool

image thumbnail

MIMOtool

by

 

12 Nov 2001 (Updated )

Multi Input Multi Output Systems Toolbox

h1.m
function h1(tipo)
%H1 : 2 finestra di sintesi e di ottimizzazione  H2 o H-INFINITY
%
%                     h0(tipo)
%
%  tipo  = stringa indicante il tipo di sintesi o di ottimizzazione
%          scelta : 'H - 2' o 'H - INFINITY'
%
%
% Massimo Davini 27/05/99 --- revised 31/05/99

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

n=stack.temp.integratori;
if get(findobj('tag','opt1'),'value')==1 ;type=1;end;  %minimizz. di [T,S]'
if get(findobj('tag','opt2'),'value')==1 ;type=2;end;  %minimizz. di [M,S]'

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

sizetext=.6;sizenota=.15;sizenota1=jsz/3+.2;

h1(1)=uicontrol('style','text','units','normalized','position',[0.05 0.89 0.19 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor',[.6 .7 .9],'HorizontalAlignment','left',...
   'string','X1 (dB)    =','tag','h1');

h1(2)=uicontrol('style','edit','units','normalized','position',[0.25 0.89 0.09 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor',[1 1 0],'HorizontalAlignment','left','tag','EditX1',...
   'HorizontalAlignment','center');

h1(3)=uicontrol('style','text','units','normalized','position',[0.05 0.79 0.19 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor',[.6 .7 .9],'HorizontalAlignment','left',...
   'string','X2 (-8..8) =','tag','h1');
 
h1(4)=uicontrol('style','edit','units','normalized','position',[0.25 0.79 0.09 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor',[1 1 0],'HorizontalAlignment','left','tag','EditX2',...
   'HorizontalAlignment','center');
 
h1(5)=uicontrol('style','push','unit','normalized','position',[0.05 0.67 0.29 0.08],...
   'fontunits','normalized','fontsize',.5,'fontweight','bold',...
   'Horizontalalignment','center','string','PLOT','tag','h1',...
   'callback','stack.temp.X1X2=plotlimiti(''EditX1'',''EditX2'',stack.temp.type,stack.temp.plant);');
 
h1(6)=uicontrol('style','Frame','units','normalized','position',[0.05 0.21 0.29 0.42],...
    'backgroundcolor',[1 1 1],'tag','h1');

h1(7)=uicontrol('style','text','units','normalized','position',[0.06 0.38 0.27 0.24],...
   'fontunits','normalized','fontsize',sizenota,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','tag','h1',...
   'position',[0.06 0.36 0.27 0.26]);

if type==1
   set(h1(7),'string','For both functions X1 is the gain in dB and (10)^X2 is the cutoff frequency');
elseif type==2
   set(h1(7),'string','X1 is the gain in dB of M while 10^X2 is the crossover fr. for M and the cutoff fr. for S');
end;

h1(8)=uicontrol('style','text','units','normalized','position',[0.06 0.22 0.27 0.15],...
   'fontunits','normalized','fontsize',sizenota1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','foregroundcolor',[1 0 0],...
   'string',sprintf('Default values are recommended !'),'tag','h1');

h1(9)=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','h1',...
   'TooltipString','Back to the previous window',...
   'callback',sprintf('back_syn(''h0'',%u,''type'',''plant'',''X1X2'',''X1'',''X2'',''Fx'');',length(stack.temp.handles))); 
 
campi=['''integratori'',''pesi'',''type'',''plant'',''X1X2'',''X1'',''X2'',''Fx'''];
h1(10)=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','h1');
 
h1(11)=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','h1',...
   'TooltipString','Go to the next window','callback',sprintf('h2(''%s'');',tipo));
 
 
drawnow;
stack.temp.handles=[stack.temp.handles,h1];


G=pck(stack.general.A,stack.general.B,stack.general.C,stack.general.D);

stack.temp.type=type;
stack.temp.plant=G;
stack.temp.X1X2=plotlimiti('EditX1','EditX2',stack.temp.type,stack.temp.plant);
stack.temp.X1=[];  %serve in caso di ottimizzazione
stack.temp.X2=[];  %serve in caso di ottimizzazione
stack.temp.Fx=[];  %serve in caso di ottimizzazione

Contact us