Documentation of idinseva


Global Index (short | long) | Local contents | Local Index (short | long)


Function Synopsis

idinseva(ax1,tag2,silent)

Help text

IDINSEVA Inserts the working or validation data set.
   The data information in ax1 is placed as working data
   (tag2='seles') or validation data (tag2='selva');
   if silent==1, no status messages are displayed

Cross-Reference Information

This function calls This function is called by

Listing of function idinseva

function idinseva(ax1,tag2,silent)

%   L. Ljung 9-27-94
%   Copyright (c) 1986-98 by The MathWorks, Inc.
%   $Revision: 3.5 $  $Date: 1997/12/02 03:41:40 $

global XIDhw XIDplotw

if nargin<3,silent=0;end
if strcmp(tag2,'seles'),ax2=XIDhw(3,1);else ax2=XIDhw(4,1);end
oldusd = get(ax2,'userdata');
par1=get(ax1,'parent');par2=get(ax2,'parent');
tag1=get(ax1,'tag');
oldtag=get(get(ax2,'zlabel'),'userdata');
if strcmp(tag1,oldtag)
   if strcmp(tag2,'seles')
      dtype='Working ';
   else
      dtype='Validation ';
   end
   iduistat([dtype,'data unchanged. No update necassary.'])
   return
end
pos2=get(ax2,'pos');pos1=get(ax1,'pos');
   usd2=get(ax2,'userdata');if isempty(usd2),usd2=[0 0];end
   hnrstring2=findobj(ax2,'type','text','tag','name');
   hnrline2=findobj(ax2,'tag','selline');
   hnrstring1=findobj(ax1,'type','text','tag','name');
   hnrline1=findobj(ax1,'tag','dataline');
   set(get(ax2,'zlabel'),'userdata',tag1); % Tagging the working/validation
                                           % data with a name tag
   set(hnrstring2,'string',get(hnrstring1,'string'),'userdata',...
                 get(hnrstring1,'userdata'),'vis','on')
   set(hnrline2,'xdata',get(hnrline1,'xdata'),...
                  'ydata',get(hnrline1,'ydata'),'vis','on',...
                  'userdata',get(hnrline1,'userdata'));
   dat_inf=get(hnrstring1,'userdata');
   eval('[ny,nu]=iduiiono(''old'',dat_inf,''dat'');')%LL!
   nystr=eval(['[',dat_inf(6,:),']']);
   nustr=eval(['[',dat_inf(7,:),']']);
   newusd=[nu,ny,nustr,nystr];
   set(ax2,'xlim',get(ax1,'xlim'),...
                  'ylim',get(ax1,'ylim'),'userdata',newusd);
   newax=0;
   if strcmp(tag2(1:5),'selva')
      Plotcolors=idlayout('plotcol');
      textcolor=Plotcolors(6,:);
      set(hnrline2,'color',textcolor);
      if iduiwok(3)
         hpred=findobj(XIDplotw(3,1),'tag','predict');
         hsim=findobj(XIDplotw(3,1),'tag','simul');
         if nu==0,
            if strcmp(get(hsim,'checked'),'on')
               idopttog('check',hpred,0);
            end
            set(hsim,'enable','off');
         else
            set(hsim,'enable','on');
         end
      end
      sampp=get(XIDplotw(3,2),'userdata');
      sampp=str2mat(sampp(1,:),sampp(2,:),'[]',sampp(4,:));
      set(XIDplotw(3,2),'userdata',sampp);
      flag=1;
      if length(newusd)==length(oldusd),if newusd==oldusd,flag=0;end,end
      eval('if flag,iduiiono(''set'',dat_inf,[3 6]);end')
      eval('iduiclpw(3);iduiclpw(6);')
      if ~silent
        iduistat(['Validation data changed to ',get(hnrstring1,'string') '.'])
      end
   else
      set(hnrline2,'color',get(hnrline1,'color'));

      ll1=iduiwok(28);if ishandle(ll1),if strcmp(get(ll1,'vis'),'on')
            iduisel('revert_io');
      end,end
      ll1=iduiwok(30);if ishandle(ll1),if strcmp(get(ll1,'vis'),'on')
            iduisel('revert_dec');
      end,end
      ll1=iduiwok(14);if ishandle(ll1),if strcmp(get(ll1,'vis'),'on')
            iduisel('open_portions');
      end,end
      ll1=iduiwok(15);if ishandle(ll1),if strcmp(get(ll1,'vis'),'on')
            iduifilt('open');
      end,end


      if nu~=usd2(1)|ny~=usd2(2)
         ll1=iduiwok(20);if ishandle(ll1),if strcmp(get(ll1,'vis'),'on')
            idparest('open');
         end,end

      else
         if nu>0,
            if ~all(nustr==usd2(3:2+nu))|~all(nystr==usd2(3+nu:ny+nu+2))
               ll1=iduiwok(21);if ishandle(ll1),if strcmp(get(ll1,'vis'),'on')
               iduiio('open');end,end
            end
         else
            if ~all(nystr==usd2(3+nu:ny+nu+2))
               ll1=iduiwok(21);if ishandle(ll1),if strcmp(get(ll1,'vis'),'on')
               iduiio('open');end,end
            end
         end

      end
      if ~silent
         iduistat(['Working data changed to ',get(hnrstring1,'string') '.'])
      end
   end