www.pudn.com > Closid30.rar > CLOBJGET.M, change:1999-02-08,size:3295b


function [model,title,info,p]=clobjget(option) 
% [model,title,info,p]=clobjget(option) 
% 
% Reads data, model or controller from the appropriate board. 
% option   'data' for data 
%          'P'    for estimated plant 
%          'Pnd'  for estimated plant coprime factors 
%          'C'    for controller 
%          'Cnd'  for controller coprime factors 
%          'X'    for auxiliary model 
%          'Xnd'  for auxiliary model coprime factors 
%          'datre' for excitation estimation data 
%          'datrv' for excitation validation data 
%          'datfe' for filtered estimation data 
%          'datfv' for filtered validation data  
%          'datw' for working data 
%          'datv' for validation data 
% title    Name of the model 
% info     Information about the model 
% p        Format of the object for plant models:  
%          0=nonparam; 1=parametric 
%          For "data" object this output variable is a 2x2 matrix 
%           containing: [rng(1) rng(N); 
%          				 tsamp  tstart]; 
%           with rng(1), rng(N) the first/last index of the data; 
%           tsamp the sampling time, and tstart the time of rng(1). 
 
% Functions called: clerrdia 
 
% 19-06-96, originally named clmodget. 
% (c) Douwe de Vries, Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 11-06-1997 
%              13-09-1998: handling working and validation data 
%              15-09-1998: enabling filtered validation data 
%              08-02-1999: correction on p row in CLIDmods 
global CLIDmods 
 
if     strcmp(option,'data'), ix=1;  strg='data set'; 
elseif strcmp(option,'P'),    ix=2;  strg='plant'; 
elseif strcmp(option,'Pnd'),  ix=3;  strg='plant factors'; 
elseif strcmp(option,'C'),    ix=4;  strg='controller'; 
elseif strcmp(option,'Cnd'),  ix=5;  strg='controller factors'; 
elseif strcmp(option,'X'),    ix=6;  strg='auxiliary model'; 
elseif strcmp(option,'Xnd'),  ix=7;  strg='auxiliary model factors'; 
elseif strcmp(option,'datre'), ix=8; strg='estimation excitation signal'; 
elseif strcmp(option,'datrv'), ix=9; strg='validation excitation signal'; 
elseif strcmp(option,'datfe'), ix=10;strg='filtered estimation data set'; 
elseif strcmp(option,'datfv'), ix=11;strg='filtered validation data set'; 
elseif strcmp(option,'datw'), ix=12; strg='working data'; 
elseif strcmp(option,'datv'), ix=13; strg='validation data'; 
else 
   return 
end 
 
if (ix<=11) 
  cm=[1:CLIDmods(1,ix)]; 
  ro=(ix-1)*5; 
  ia=find(CLIDmods(ro+2,cm)==1); 
  if isempty(ia) 
    clerrdia(['ERROR: no active ' strg ' available'],1) 
    return 
  end 
  if length(ia)>1 
    clerrdia(['ERROR: only one ' strg ' can be selected'],1) 
    return 
  end 
  model=get(CLIDmods(ro+6,ia),'Userdata'); 
  title=get(CLIDmods(ro+5,ia),'String'); 
  info=get(CLIDmods(ro+5,ia),'Userdata'); 
  if ix==2 
    p=CLIDmods(57,ia);   % Corrected 58-->57, 08/02/99 
  elseif (ix==1 | ix==9 | ix==10 | ix==11) 
    p=get(CLIDmods(ro+4,ia),'Userdata'); 
  end 
% 
% Added 11-09-1998: 
else 
  model=get(CLIDmods(6,CLIDmods(46+ix,1)),'Userdata');   
  title=get(CLIDmods(5,CLIDmods(46+ix,1)),'String'); 
  info=get(CLIDmods(5,CLIDmods(46+ix,1)),'Userdata'); 
  p=get(CLIDmods(4,CLIDmods(46+ix,1)),'Userdata'); 
end