www.pudn.com > Closid30.rar > CLOSID.M, change:1998-09-16,size:22011b


function closid 
% Invokes the closed-loop identification toolbox main window GUI. 
 
% Functions called: clload, clsetcol, clwimxmc,clobjdel, 
%                   clwidgen,clwimpd,clobjget,clcdplot,clmodev 
%                   clobjact,cldrgdat 
 
% 20-04-1996 
% (c) Paul Van den Hof, Douwe de Vries, Edwin van Donkelaar 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 19-05-1998 
 
% Check if CLOSID-window is already there; if not, create the window 
% and initialize. 
CLmainh=findobj(get(0,'children'),'flat','tag','CLMAIN'); 
if ~isempty(CLmainh) 
   figure(CLmainh) 
else  
   % Globals 
   global CLIDmods CLIDmodn CLIDmnum CLIDcols CLIDcolf CLIDscrz CLIDevas 
   global CLIDmeth 
 
   % Set the colors of the different objects: 
   CLIDcolf=[0.5 0.5 0.5 ;       % 1  frame 				 frmcol 
             1   1   0  ;       % 2  text  
             1   1   1  ;       % 3  edit - backg            edicol 
             0   0   0  ;       % 4  push buttons - backg 
             0   0   0  ;       % 5  radio buttons 
             1   1   1  ;       % 6  axis  
             0.5 0.5 0.5;       % 7  data/controller plots 
             0.5 0.5 0.5;       % 8  not defined yet 
             0   0   0  ;       % 9  not defined yet 
             0   0   0  ;       % 10 not defined yet 
             1   1   0  ;       % Model #1  
             1   0   1  ;       % Model #2   
             0   1   1  ;       % Model #3  
             1   0   0  ;       % Model #4  
             0   1   0  ;       % Model #5  
             0   0   1  ;       % Model #6  
             1   0.5 0  ;       % Model #7  
             1   0   0.5;       % Model #8  
             0   1   0.5;       % Model #9  
             0.5 1   0  ;       % Model #10 
             0.5 0   1  ;       % Model #11 
             1   0.5 0.5;       % Model #12 
             0   0   0  ;       % edit - text           edtcol 
             0   0   1  ;       % pop-up -back       
             1   1   0  ;       % pop-up -text    
             0   0   1  ;       % checkb - back   
             1   1   0  ;       % checkb - text   
             0.5 0.5 0.5;       % text-backgr     
             1   1   0 ];       % pushbut - text 
   if exist('cl_prefs.mat') 
      [err,CLIDcols]=clload('clprefs','CLIDcols'); 
   else 
      CLIDcols=CLIDcolf; 
   end 
   [frmcol,txtcol,edicol,pshcol,radcol,axscol,c7,c8,c9,c10,... 
      modcol,edtcol,pubcol,putcol,chbcol,chtcol,txbcol,pstcol]=clsetcol; 
 
% Compile m-functions 
   if 1==2 then 
% Add the important m-files here for fast compilation: 
     clwidgen 
	 clmodest 
	 clmodqs 
	 clwcopmb 
	 clmodcop 
   end 
 
% Determine screen size and position and size of main CLOSID-window: 
   CLIDscrz=get(0,'Screensize'); 
   z=CLIDscrz; 
   posfgm=[(z(3)-z(1)+1)/2-300 (z(4)-z(2)+1)/2-200 615 390]; 
 
% Define standard hight of text-field displays: 
   SBH=0.04; 
 
%********************************************************************* 
% 
%                OPEN MAIN WINDOW 
% 
%********************************************************************* 
   clfgm=figure('Menubar','none','Color',frmcol,... 
      'pos',posfgm,... 
      'Numbertitle','off','Name','CLOSID',... 
      'Resize','on','HandleVisibility','on',... 
	  'Backingstore','on',... 
      'DefaultAxesBox','on','DefaultAxesColor',frmcol, ... 
      'DefaultAxesDrawMode','fast','DefaultAxesUnit','norm', ... 
      'DefaultAxesYTick',[],'DefaultAxesYTickLabel',[], ... 
      'DefaultAxesXTick',[],'DefaultAxesXTickLabel',[], ... 
      'DefaultAxesXColor',axscol,'DefaultAxesYColor',axscol, ... 
      'DefaultAxesZColor',axscol, ... 
      'TAG','CLMAIN');	   
 
%********************************************************************* 
%           
%               CONSTRUCT MENU BAR 
% 
%********************************************************************* 
% 
   mnu=zeros(4,4); 
   mnuhlp='hthelp(''clidhlp.htm'')'; 
   mnu(1,1)=uimenu(clfgm,'label','File'); 
     mnu(1,2)=uimenu(mnu(1,1),'label','Load session','callb','clgetses'); 
     mnu(1,3)=uimenu(mnu(1,1),'label','Save session','callb','clsavses'); 
     mnu(1,4)=uimenu(mnu(1,1),'sepa','on','label','Exit','callb',... 
      ['clyesno(''close(gcf);'',''Exit? All variables will be lost. '');']); 
   mnu(2,1)=uimenu(clfgm,'label','Settings'); 
     mnu(2,2)=uimenu(mnu(2,1),'label','Colors','callb','cledicol;'); 
     mnu(2,3)=uimenu(mnu(2,1),'label','Save settings',... 
             'callb','clsave(''settings'');'); 
   mnu(3,1)=uimenu(clfgm,'label','Help'); 
     mnu(3,2)=uimenu(mnu(3,1),'label','Intro',... 
	                 'callb','hthelp(''clintro.htm'')'); 
     mnu(3,3)=uimenu(mnu(3,1),'label','Help index',... 
	                 'callb','hthelp(''clindex.htm'')'); 
	 mnu(3,4)=uimenu(mnu(3,1),'label','About Closid','sepa','on',... 
					 'callb','hthelp(''clabout.htm'')'); 
	                  
	       
%********************************************************************* 
%           
%            DATA IMPORT POP-UP MENU 
% 
%********************************************************************* 
% 
% Construct pop-up menu for import of data 
   mfdatx=0.02;mfdaty=0.92; 
   mfdatpos=[mfdatx mfdaty 0.24 SBH; 
             mfdatx mfdaty 0.01 0.01]; 
   strdata=['data|import|delete']; 
   mfdat=zeros(2,1); 
% Pop-up menu: 
   mfdat(1)=uicontrol(clfgm,'style','popup','uni','nor',... 
      'string',strdata,'pos',mfdatpos(1,:),'fore',putcol,... 
      'back',pubcol,'TAG','CLMAINPOPDATA'); 
% Invisible uicontrol for storing info 
   mfdat(2)=uicontrol(clfgm,'style','edit','uni','nor',... 
      'Back',edicol,'Fore',edtcol,'pos',mfdatpos(2,:),'visible','off',... 
      'TAG','CLDATADES'); 
% 
% CALLBACKS: 
   datimpa=['if get(gco,''value'')==2,clwimpd;'... 
    'elseif get(gco,''value'')==3,clobjdel(''data'',1),end;']; 
%    'clyesno(''clobjdel(''''data'''');'',''Delete highlighted data?'');',... 
%	 'end;']; 
%     'clobjdel(''data''),end;']; 
   set(mfdat(1),'callb',datimpa); 
% 
% Userdata of mfdat(2) stored with signal information: 
% Assign the data 
  % description: [common range y u r2 r1; 
  %               common range y_c u_c relative to y u; 
  %               common range y_c_f u_c_f relative to y_c u_c; 
  %               sampling time, starting time; 
  %               number of outputs, number of inputs] 
   set(mfdat(2),'Userdata',[0 0;0 0;0 0;1 1;1 1]); 
 
%********************************************************************* 
%           
%            DATA VIEW CHECK BOXES 
% 
%********************************************************************* 
% 
% Construct Data view Check Boxes 
   mfdvx=0.02;mfdvy=0.60; 
   mfdvpos=[mfdvx mfdvy 0.24 1.2*SBH; 
           mfdvx mfdvy 0.24 1.2*SBH; 
           mfdvx mfdvy-0.06 0.24 1.2*SBH]; 
   mfdv=zeros(3,1); 
%  mfdv(1)=uicontrol(clfgm,'style','text','uni','nor',... 
%      'pos',mfdvpos(1,:),'string','DATA VIEW'); 
   mfdv(2)=uicontrol(clfgm,'style','check','uni','nor',... 
      'Back',chbcol,'Fore',chtcol,... 
      'pos',mfdvpos(2,:),'string','Time-plot','tag','CLDATATVIEW'); 
   mfdv(3)=uicontrol(clfgm,'style','check','uni','nor',... 
      'Back',chbcol,'Fore',chtcol,... 
      'pos',mfdvpos(3,:),'string','Spectrum','tag','CLDATAFVIEW'); 
% 
% CALLBACK strings 
   clb1=[... 
    'if get(findobj(''tag'',''CLDATATVIEW''),''value'')==0,'... 
      'close(findobj(''tag'',''DATATPLOT''));'... 
    'elseif [get(findobj(''tag'',''CLDATATVIEW''),''value'')==1 ~isempty(clobjget(''data''))],'... 
      'cldcplot(''td'');',...   
    'end'... 
    ]; 
   set(mfdv(2),'callb',clb1); 
%  
   clb2=[... 
    'if get(findobj(''tag'',''CLDATAFVIEW''),''value'')==0,'... 
     'close(findobj(''tag'',''DATAFPLOT''));'... 
    'elseif [get(findobj(''tag'',''CLDATAFVIEW''),''value'')==1 ~isempty(clobjget(''data''))],'... 
     'cldcplot(''fd'');',...   
    'end'... 
    ]; 
   set(mfdv(3),'callb',clb2); 
 
%********************************************************************* 
%           
%            MODEL IMPORT / EXPORT   POP-UP MENU 
% 
%********************************************************************* 
% 
   mfvalx=0.62;mfvaly=0.92; 
   mfvalpos=[mfvalx mfvaly 0.25 SBH]; 
   strval='model|import|export|delete'; 
   mfval=zeros(1,1); 
   modimpa=['if get(gco,''value'')==2, clwimxmc(''M'',''imp'');'... 
            'elseif get(gco,''value'')==3, clwimxmc(''M'',''exp'');'... 
            'elseif get(gco,''value'')==4,'... 
            'clyesno(''clobjdel(''''model'''');'',''Delete highlighted model(s)?'');'... 
            'end;']; 
   mfval(1)=uicontrol(clfgm,'style','popup','uni','nor',... 
      'String',strval,'Userdata',0,... 
      'fore',putcol,'back',pubcol,... 
      'pos',mfvalpos(1,:),'TAG','CLMAINPOPMOD',... 
      'callb',modimpa); 
 
%********************************************************************* 
%           
%            CONTROLLER IMPORT / EXPORT   POP-UP MENU 
% 
%********************************************************************* 
% 
   mfctx=0.02;mfcty=0.42; 
   mfctpos=[mfctx mfcty 0.24 SBH]; 
   strcta=['controller|import|export|delete']; 
   mfctl=zeros(1,1); 
   ctlimpa=['if get(gco,''value'')==2, clwimxmc(''C'',''imp'');'... 
    'elseif get(gco,''value'')==3,'... 
    'clwimxmc(''C'',''exp'');'... 
    'elseif get(gco,''value'')==4,'... 
    'clyesno(''clobjdel(''''contr'''');'',''Delete highlighted controller?'');'...    
            'end;']; 
   mfctl(1)=uicontrol(clfgm,'style','popup','uni','nor',... 
      'callb',ctlimpa,... 
      'fore',putcol,'back',pubcol,... 
      'string',strcta,'pos',mfctpos(1,:),... 
      'TAG','CLMAINPOPCONTR'); 
 
%********************************************************************* 
%           
%            CONTROLLER VIEW CHECK BOXES 
% 
%********************************************************************* 
% Construct Controller view Check Boxes 
   mfcvx=0.02;mfcvy=0.10; 
   mfcvpos=[mfcvx mfcvy 0.24 1.2*SBH]; 
   mfcv=zeros(1,1); 
   mfcv(1)=uicontrol(clfgm,'style','check','uni','nor',... 
       'Back',chbcol,'Fore',chtcol,'pos',mfcvpos(1,:),... 
       'string','Freq. response','tag','CLCONVIEW'); 
   clb0=[... 
     'if get(findobj(''tag'',''CLCONVIEW''),''value'')==0,'... 
     'close(findobj(''tag'',''CONPLOT''));'... 
     'elseif [get(findobj(''tag'',''CLCONVIEW''),''value'')==1],'... 
     'cldcplot(''fc'');',... 
     'end'... 
     ]; 
   set(mfcv(1),'callb',clb0); 
 
%********************************************************************* 
%           
%            IDENTIFICATION METHOD  POP-UP MENU 
% 
%********************************************************************* 
% 
   stridm{1}='identification'; 
   stridm{2}='two-stage'; 
   stridm{3}='indirect'; 
   stridm{4}='tailor-made'; 
   stridm{5}='IV'; 
   stridm{6}='coprime factors'; 
   stridm{7}='dual-Youla'; 
   stridm{8}='nonparametric'; 
%   stridm=['identification|two-stage|indirect|',... 
%   'tailor-made|IV|coprime factors|dual-Youla|nonparametric']; 
   mfidx=0.28;mfidy=0.42; 
   mfidpos=[mfidx mfidy 0.21 1.5*SBH]; 
   mfid=zeros(1,1); 
   mfid(1)=uicontrol(clfgm,'style','popup','uni','nor',... 
      'String',stridm,'Userdata',0,... 
      'fore',putcol,'back',pubcol,'TAG','CLMAINPOPIDENT',... 
      'callb',['clwidgen(get(gco,''value'')-1);'],... 
      'pos',mfidpos(1,:)); 
% CLIDmnum: contains the number of models estimated for each method 
%           listed in stridm 
  CLIDmnum=zeros(1,length(stridm)-1); 
%  get(mfid(1),'max')-get(mfid(1),'min')); 
% 
% Store name strings of identification windows in global varibale CLIDmeth 
% 
CLIDmeth{1}='Two-stage identification'; 
CLIDmeth{2}='Indirect identification'; 
CLIDmeth{3}='Tailor-made identification'; 
CLIDmeth{4}='IV identification'; 
CLIDmeth{5}='Coprime factor identification'; 
CLIDmeth{6}='Dual-Youla identification'; 
CLIDmeth{7}='Spectral estimation'; 
 
%********************************************************************* 
%           
%                 MODEL EVALUATION BOARD 
% 
%********************************************************************* 
% Construct Model evaluation block 
   mfevx=0.55; mfevy=0.40; 
   mfevpos=[mfevx mfevy 0.35 1.7*SBH; 
       mfdatx+0.48 mfevy-0.08 0.25 1.7*SBH;      % Closed-loop transfers 
       mfdatx+0.48 mfevy-0.15 0.25 1.7*SBH; 
       mfdatx+0.48 mfevy-0.22 0.25 1.7*SBH; 
       mfdatx+0.745 mfevy-0.08 0.23 1.7*SBH;      % Closed-loop transfers 
       mfdatx+0.745 mfevy-0.15 0.23 1.7*SBH; 
       mfdatx+0.745 mfevy-0.22 0.23 1.7*SBH;      % Plant transfer     
       mfdatx+0.745 mfevy-0.29 0.23 1.7*SBH ];    % Plant pole-zeros 
   mfev=zeros(8,1); 
%  Header-text: 
   mfev(1)=uicontrol(clfgm,'style','text','uni','nor',... 
     'Fore',txtcol,'Back',txbcol,... 
     'pos',mfevpos(1,:),'string','MODEL EVALUATION'); 
% 
%  Closed-loop transfers 
   mfev(2)=uicontrol(clfgm,'style','check','uni','nor',... 
      'pos',mfevpos(2,:),'string','cl-loop f-response',... 
      'Back',chbcol,'Fore',chtcol,'tag','CLTRANSVAL'); 
% 
% Closed-loop poles 
   mfev(3)=uicontrol(clfgm,'style','check','uni','nor',... 
      'pos',mfevpos(3,:),'string','cl-loop pole-zeros',... 
      'Back',chbcol,'Fore',chtcol,'tag','CLPOLESVAL'); 
% 
% i/o simulation 
   mfev(4)=uicontrol(clfgm,'style','check','uni','nor',... 
      'pos',mfevpos(4,:),'string','i/o simulation',... 
      'Back',chbcol,'Fore',chtcol,'tag','CLSIMVAL'); 
% 
% Residual test 
   mfev(5)=uicontrol(clfgm,'style','check','uni','nor',... 
      'pos',mfevpos(5,:),'string','residual test',... 
      'Back',chbcol,'Fore',chtcol,'tag','CLRESIDVAL'); 
% 
% Step response  
   mfev(6)=uicontrol(clfgm,'style','check','uni','nor',... 
      'pos',mfevpos(6,:),'string','transient response',... 
      'Back',chbcol,'Fore',chtcol,'tag','CLSTEPVAL'); 
% 
% Plant transfer 
   mfev(7)=uicontrol(clfgm,'style','check','uni','nor',... 
      'pos',mfevpos(7,:),'string','plant f-response',... 
      'Back',chbcol,'Fore',chtcol,'tag','CLOLTRVAL'); 
% 
% Plant pole-zeros 
   mfev(8)=uicontrol(clfgm,'style','check','uni','nor',... 
      'pos',mfevpos(8,:),'string','plant pole-zeros',... 
      'Back',chbcol,'Fore',chtcol,'tag','CLOLPZVAL'); 
% 
 
% Store name strings of evaluation methods in global varibale CLIDevas 
% 
CLIDevas{1}='Closed-loop transfers'; 
CLIDevas{2}='Closed-loop poles'; 
CLIDevas{3}='Closed-loop simulation'; 
CLIDevas{4}='Residual tests'; 
CLIDevas{5}='Closed-loop transients'; 
CLIDevas{6}='Plant transfer function'; 
CLIDevas{7}='Plant pole-zeros'; 
 
 
% CALLBACK STRINGS 
% 
   cbev1=['if get(findobj(''tag'',''CLTRANSVAL''),''value'')==1,'... 
            'clmodev(1),'...   
          'else,'...  
            'close(findobj(''TAG'',''CLTFFIG'')),'... 
          'end']; 
   cbev2=['if get(findobj(''tag'',''CLPOLESVAL''),''value'')==1,'... 
                'clmodev(2),'...   
               'else,'...  
                 'close(findobj(''TAG'',''CLPOFIG'')),'... 
               'end']; 
   cbev3=['if get(findobj(''tag'',''CLSIMVAL''),''value'')==1,'... 
                'clmodev(3),'...   
               'else,'...  
                 'close(findobj(''TAG'',''CLIOFIG'')),'... 
               'end']; 
   cbev4=['if get(findobj(''tag'',''CLRESIDVAL''),''value'')==1,'... 
                'clmodev(4),'...   
               'else,'...  
                 'close(findobj(''TAG'',''CLCORFIG'')),'... 
               'end']; 
   cbev5=['if get(findobj(''tag'',''CLSTEPVAL''),''value'')==1,'... 
                'clmodev(5),'...   
               'else,'...  
                 'close(findobj(''TAG'',''CLSTFIG'')),'... 
               'end']; 
   cbev6=['if get(findobj(''tag'',''CLOLTRVAL''),''value'')==1,'... 
                'clmodev(6),'...   
               'else,'...  
                 'close(findobj(''TAG'',''OLTFFIG'')),'... 
               'end']; 
   cbev7=['if get(findobj(''tag'',''CLOLPZVAL''),''value'')==1,'... 
                'clmodev(7),'...   
               'else,'...  
                 'close(findobj(''TAG'',''OLPOFIG'')),'... 
               'end']; 
   set(mfev(2),'callb',cbev1); 
   set(mfev(3),'callb',cbev2); 
   set(mfev(4),'callb',cbev3); 
   set(mfev(5),'callb',cbev4); 
   set(mfev(6),'callb',cbev5); 
   set(mfev(7),'callb',cbev6); 
   set(mfev(8),'callb',cbev7); 
 
%************************************************************************* 
 
   % Create the data, controller and model axes 
   %   Data: 
   % y u r2 r1 
   %   Format: 
   % controllers,auxiliary models: mu-alike state space format 
   % idem factorizations         : idem ND format 
   % estimated models            : theta format 
   %   CLIDmods: 
   % row 1     : number of data axes, model axes, controller axes, 
   %             controller factor axes, auxiliary model axes and 
   %             auxiliary model factor axes respectively 
   % row 2     : indicates active data axes with a one 
   % row 3     : indicates occupied data axes with a one 
   % row 4     : axes handles 
   % row 5     : text handles 
   % row 6     : line handles 
   % row 7:11  : similar to row 2:6 but for estimated models 
   % row 12:16 : similar to row 2:6 but for estimated model ND factors 
   % row 17:21 : similar to row 2:6 but for controllers 
   % row 22:26 : similar to row 2:6 but for controller ND factors 
   % row 27:31 : similar to row 2:6 but for auxiliary models 
   % row 32:36 : similar to row 2:6 but for auxiliary model ND factors 
   % row 37:41 : similar to row 2:6 but for data prefilters 
   % row 42:46 : similar to row 2:6 but for reconstructed (excitation) data 
   % row 47:51 : similar to row 2:6 but for filtered estimation data 
   % row 52:56 : similar to row 2:6 but for filtered validation data 
 
   CLIDmodn=str2mat('data','Phat','PNDhat','C','CND','X','XND',... 
      'datre','datrv','datfe','datfv','datw','datv'); 
   AWH=4*SBH*[0.70 2/(1+sqrt(5))]; 
   ofs=0.90*(AWH(2)+SBH); 
   hofs=1.1*AWH(1); 
   posinv=[0 0 0.01 0.01]; 
   kdx=2; kdy=2; kd=kdx*kdy; 
   kcx=2; kcy=2; kc=kcx*kcy; 
   kmx=4; kmy=3; km=kmx*kmy; 
   kmf=km; 
   kcf=1; ka=1; kaf=1; kp=1; kdt1=1; kdt2=1; kdt3=1; % must be one 
   cix=[kd km kmf kc kcf ka kaf kp kdt1 kdt2 kdt3]; 
   noc=length(cix); 
   fstr=[kdx kmx 0 kcx; kdy kmy 0 kcy]; 
   CLIDmods=zeros(noc*5+1,max([noc cix])); 
   CLIDmods(1,1:noc)=cix; 
   zcx=[0 cix]; 
   mfaxs=zeros(sum(cix),1); 
   for k=[1 2 4]                  % visible axes 
      for i=1:fstr(1,k) 
       for j=1:fstr(2,k) 
         tel=(j-1)*fstr(1,k)+i; 
         if     k==1, strtag='DATA';  mfx=mfdatx; mfy=mfdaty; 
         elseif k==2, strtag='MODEL'; mfx=mfdatx+0.49; mfy=mfdaty; 
         elseif k==4, strtag='CONTR'; mfx=mfctx;  mfy=mfcty; 
         end 
         kxx=sum(zcx(1:k)); 
         mfaxs(tel+kxx) = axes('NextPlot','add',... 
            'Position',[mfx+(i-1)*hofs mfy-j*ofs AWH],... 
            'TAG',['CLAXIS' strtag '_' int2str(k) '_' int2str(tel)],... 
            'ButtonDownFcn',['clobjact(1),cldrgdat;']); 
         if k==2|k==4 
          set(mfaxs(tel+kxx),'XScale','log','YScale','log'); 
         end 
         texh = text('pos',[0.5 0],'units','norm',... 
            'verticalalignment','bottom','fontsize',10,... 
            'horizontalalignment','center',... 
            'TAG',['CLAXIS' strtag '_' int2str(k) '_' int2str(tel)],... 
            'ButtonDownFcn','clobjact(2)'); 
         linh = line('color',modcol(tel,:),'erasemode','normal',... 
            'TAG',['CLAXIS' strtag '_' int2str(k) '_' int2str(tel)],... 
            'vis','off','ButtonDownFcn','clobjact(2)'); 
         CLIDmods(k*5+[-1:1],tel)=[mfaxs(tel+kxx);texh;linh]; 
       end 
      end 
   end 
   for k=[3 5 6 7 8 9 10 11]         % invisible axes 
      for i=1:cix(k) 
         if     k==3,  strtag='MODELFAC'; 
         elseif k==5,  strtag='CONTRFAC'; 
         elseif k==6,  strtag='AUXIL'; 
         elseif k==7,  strtag='AUXILFAC'; 
         elseif k==8,  strtag='DATARE'; 
         elseif k==9,  strtag='DATARV'; 
         elseif k==10, strtag='DATAFE'; 
		 elseif k==11, strtag='DATAFV'; 
         end 
         kxx=sum(zcx(1:k)); 
         mfaxs(i+kxx) = axes('Position',posinv,... 
            'TAG',['CLAXIS' strtag int2str(i)],'vis','off'); 
         texh = text('pos',[0.5 0],'units','norm',... 
            'fontsize',10,'vis','off'); 
         linh = line('color',modcol(i,:),'erasemode','normal',... 
            'vis','off'); 
         CLIDmods(k*5+[-1:1],i)=[mfaxs(i+kxx);texh;linh]; 
      end 
   end 
 
%  Added 11-09-1998: 
%  Axes for working and validation data: 
   axhw = axes('Position',[mfdatx+0.31 mfdaty-0.38 AWH],... 
   'TAG','CLAXISDATE'); 
   texhw=text('pos',[0.5 0],'units','norm',... 
            'verticalalignment','bottom','fontsize',10,... 
            'horizontalalignment','center',... 
            'TAG','CLAXISDATE'); 
   linhw = line('erasemode','normal',... 
            'TAG','CLAXISDATW',... 
            'vis','off'); 
   axhv = axes('Position',[mfctx+0.54 mfcty-0.36 AWH],... 
   'TAG','CLAXISDATV'); 
   mfdatae=uicontrol(clfgm,'style','text','uni','nor',... 
     'Fore',axscol,'Back',txbcol,... 
     'pos',[mfdatx+0.29 mfdaty-0.28 0.15 0.05],'string','Working data'); 
   mfdatav=uicontrol(clfgm,'style','text','uni','nor',... 
     'Fore',axscol,'Back',txbcol,... 
     'pos',[mfctx+0.52 mfcty-0.42 0.15 0.05],'string','Validation data'); 
   texhv=text('pos',[0.5 0],'units','norm',... 
            'verticalalignment','bottom','fontsize',10,... 
            'horizontalalignment','center',... 
            'TAG','CLAXISDATV');			 
   linhv = line('erasemode','normal',... 
            'TAG','CLAXISDATV',... 
            'vis','off'); 
   CLIDmods(58:59,2:4)=[axhw texhw linhw;axhv texhv linhv]; 
 
 
   % Draw the figure 
   drawnow 
 
% Put handles in userdata of figure 
   r=length(mfaxs); 
   us=zeros(r,6); 
   us(1:length(mfdat),1)=mfdat; 
   us(1:length(mfctl),2)=mfctl; 
   us(1:length(mfid),3)=mfid; 
   us(1:length(mfval),4)=mfval; 
   us(1:length(mfaxs),5)=mfaxs; 
   us(1:size(mnu,1),6)=mnu(:,1); 
   set(clfgm,'Userdata',us); 
 
end