www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@mdev_local/delchild.m

    function mdev=delchild(mdev,chindex);
% MDEV_LOCAL/DELCHILD handles mdev_local part of delete response feature node from tree
%
% called from tree/delete

%  Copyright 2000-2005 The MathWorks, Inc. and Ford Global Technologies, Inc.



L= model(mdev);

D= mdev.RFData.info;
D= D(:,1:size(D,2)~=chindex);
mdev.RFData.info= D;

% account for possible non RF datum model
ind=  chindex-RFstart(L);
if ind>0 & ind<=size(get(L,'Values'),1)
   
   % delete rf from localmod
   L= DelFeat(L,ind);
   mdev=model(mdev,L);
   
   % update rf covariance
   mdev.MLE.Sigma(ind,:,:)=[];
   mdev.MLE.Sigma(:,ind,:)=[];
   
   % could be deleting an rf in bestmodel
   if ~isempty(mdev.ResponseFeatures)
      if any(mdev.ResponseFeatures(:)==ind);
           mdev= BestModel(mdev,0);
           mdev.ResponseFeatures=[];
           mdev.TwoStage= [];
      else
          % mdev.ResponseFeatures uses indices rather than pointers
          rf= mdev.ResponseFeatures;
          mdev.ResponseFeatures(rf>ind)= mdev.ResponseFeatures(rf>ind)-1;
      end

	
      if mdev.IsLinearised
         [mdev,OK]= GTSfit(mdev);
      end
   end


   p=pointer(mdev);
end