function [str,props,type,values] = iddef(arg)
%IDDEF  basic definition of structures used in IDENT
%

%   Copyright 1986-2000 The MathWorks, Inc.
%   $Revision: 1.10 $ $Date: 2000/08/24 12:53:41 $

switch arg
case 'algorithm'
   props    = {'Approach','Focus','MaxIter','Tolerance','LimitError','MaxSize',...
         'SearchDirection','FixedParameter','Trace','N4Weight',...
         'N4Horizon','Advanced'};
   
   sea = struct('GnsPinvTol',1e-9,'LmStep',2,'StepReduction',2,'MaxBisections',10,...
      'LmStartValue',0.001,'RelImprovement',0);
   thresh = struct('Zstability',1.01,'Sstability',0,'AutoInitialState',1.2);
   advanced = struct('Search',sea,'Threshold',thresh);
   values   = {'Pem','Prediction',20,0.01,1.6,'Auto','Auto',[],'Off',...
         'Auto','Auto',advanced};
   str      = cell2struct(values,props,2);
   if nargout > 2
      type = {{'Pem','Arx','Subspace','Iv'},...
            {'Prediction','Simulation','Stability'},...
            {'integer'},{'positive'},{'positive'},...
            {'integer'},{'Auto','Lm','Gns','Gn'},{''},{'Off','On','Full'},...
            {'Auto','MOESP','CVA'},{'intarray'},{'struct'}};
   end
   
case 'structpoly'
   props  = {'na','nb','nc','nd','nf','nk','InitialState'};
   values = {0,[],0,0,[],[],'Zero'};
   str    = cell2struct(values,props,2); 
   if nargout > 2
      type  = {{'integer'},{'integer'},{'integer'},{'integer'},{'integer'},...
            {'integer'},{'Zero','Estimate','Backcast','Auto'}};
   end
   
case 'estimation'
   props = {'Status','Method','LossFcn','FPE','DataName','DataLength','DataTs',...
         'DataInterSample','WhyStop','UpdateNorm','LastImprovement','Iterations'};
   values={'Not estimated',[],[],[],[],[],[],[],[],[],[],[]};
   str = cell2struct(values,props,2); 
   if nargout > 2
      type  ={{'Not estimated','Estimated model',...
               'Model modified after last estimate'},...
            {'positive'},{'positive'},{'string'},{'integer'},{'positive'},...
            {'Zero order hold','First order hold','BandLimited'},{'string'},...
            {'positive'},{'positive'},{'integer'}};
   end
otherwise
   error('Unrecognized input option.');
end
