function ea_0
%EA_0 : funzione di creazione della prima finestra EIG/ASSIGN
%
%
% Massimo Davini 07/10/99 revised 17/04/2000
% put delgraf instead of delete(findobj('tag','grafico'));
% 25/may/02 Giampy
global stack;
if stack.general.K_flag
messag(gcf,'kns_m',[],'eig \ assign',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='EIG \ ASSIGN';
set(gcf,'Name',sprintf(' MIMO Tool : SYNTHESIS %s --> %s',stack.general.model,tipo));
% enlarge text if java machine is running
jsz=stack.general.javasize;
st=.8;sizetext=.1333;
ea(1)=uicontrol('style','frame',...
'units','normalized','position',[0.1 0.74 0.8 0.21],...
'backgroundcolor',[1 1 1],'visible','off','tag','ea0');
ea(2)=uicontrol('style','radiobutton',...
'units','normalized','position',[.13 .88 .74 0.05],...
'fontunits','normalized','fontsize',st,'fontweight','bold',...
'backgroundcolor',[1 1 1],'visible','off',...
'HorizontalAlignment','left','tag','eaopt1',...
'string',' pseudo FULL STATE Feedback Control Law',...
'value',1,'foregroundcolor','red');
ea(3)=uicontrol('style','radiobutton',...
'units','normalized','position',[.13 .82 .74 0.05],...
'fontunits','normalized','fontsize',st,'fontweight','bold',...
'backgroundcolor',[1 1 1],'visible','off',...
'HorizontalAlignment','left','tag','eaopt2',...
'string',' OUTPUT Feedback Control Law');
ea(4)=uicontrol('style','radiobutton',...
'units','normalized','position',[.13 .76 .74 0.05],...
'fontunits','normalized','fontsize',st,'fontweight','bold',...
'backgroundcolor',[1 1 1],'visible','off',...
'HorizontalAlignment','left','tag','eaopt3',...
'string',' CONSTRAINED OUTPUT Feedback Control Law');
rows=size(stack.general.B,2);
columns=size(stack.general.C,1);
if (rows>10)|(columns>10) set(ea(4),'enable','off');end;
cb=['tmpcbvar(1)=findobj(''tag'',''eaopt1'');',...
'tmpcbvar(2)=findobj(''tag'',''eaopt2'');',...
'tmpcbvar(3)=findobj(''tag'',''eaopt3'');',...
'set(tmpcbvar(1:3),''foregroundcolor'',''black'',''value'',0);',...
'set(gcbo,''foregroundcolor'',''red'',''value'',1);clear tmpcbvar;'];
set(ea(2:4),'callback',cb);
ea(5)=uicontrol('style','frame',...
'units','normalized','position',[0.1 0.22 0.8 0.46],...
'backgroundcolor',[1 1 1],'visible','off','tag','ea0');
ea(6)=uicontrol('style','text',...
'units','normalized','position',[.13 .565 .6 0.05],...
'fontunits','normalized','fontsize',st,...
'fontweight','bold','visible','off',...
'backgroundcolor',[1 1 1],'foregroundcolor','red',...
'HorizontalAlignment','left','tag','ea0',...
'string',sprintf('Number of desired eigenvalues (max %u):',size(stack.general.A,1)));
ea(7)=uicontrol('style','edit',...
'units','normalized','position',[0.77 0.56 0.1 0.06],...
'fontunits','normalized','fontsize',jsz/2+.65,...
'fontweight','bold','tag','ea0_edit',...
'backgroundcolor','yellow','visible','off',...
'string',num2str(size(stack.general.A,1)));
str1=sprintf('\nThe rank(B) = %u determines the dimension of the subspace in which the achievable ',rank(stack.general.B));
str2=sprintf('eigenvectors must reside. Then if you specify %u entries (or less) for each desired eigenvector ',rank(stack.general.B));
str3=['it''ll be possible to obtain their exact value.'];
ea(8)=uicontrol('style','text','units','normalized','position',[.13 .25 .74 0.3],...
'fontunits','normalized','fontsize',sizetext,'fontweight','bold',...
'backgroundcolor',[1 1 1],'visible','off',...
'HorizontalAlignment','left','tag','ea0',...
'string',[str1,str2,str3]);
ea(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','ea0',...
'TooltipString','Back to the main SYNTHESIS window',...
'callback','back_syn(''syn0'',0);');
ea(10)=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','ea0',...
'TooltipString','Go to the next window','callback','ea_01;');
drawnow;
set(ea,'visible','on');
drawnow;
%aggiornamento handles temporanei
stack.temp.handles=[stack.temp.handles,ea];