www.pudn.com > Closid30.rar > Cl2sitb.m, change:1998-09-17,size:2610b


function cl2sitb(y,u,data_d,data_n,inp_n,out_n,yv,uv,data_dv,data_nv,inp_nv,out_nv) 
% cl2sitb(y,u,data_d,data_n,inp_n,out_n,yv,uv,data_dv.data_nv,inp_nv,out_nv) 
% 
% Copies data to the data board in Ljung's SITB. 
% y         Output data 
% u         Input data 
% data_d    Description of the data 
% data_n    Name of the data 
% inp_n     Name of the input 
% out_n     Name of the output 
% yv        Validation output data 
% uv        Validation input data 
% data_dv   Description of the validation data 
% data_nv   Name of the validation data 
% inp_nv    Name of the validation input 
% out_nv    Name of the validation output 
 
 
% Functions called: iduifile,iduiinsd,idinseva,clobjget 
 
% 04-06-96 
% (c) Douwe de Vries, Edwin van Donkelaar, Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 02-06-1997 
%              26-08-1998  Corrected reading of sampling interval; 
%              03-09-1998  Minor bug. 
%              17-09-1998  Copying (Closid) data also to validation data sets. 
 
global CLIDmods 
 
nu=size(u,2); 
[Nny,ny]=size(y); 
nustr=[];nystr=[]; 
for kk=1:nu 
   nustr=[nustr,int2str(kk),' ']; 
end 
for kk=1:ny 
   nystr=[nystr,int2str(kk),' ']; 
end 
% 
%% Correction 26-08-1998: reading correct sample time 
%h=findobj('TAG','CLDATADES'); 
%tmp=get(h,'Userdata'); 
%str1=num2str(tmp(4,1));       % sampling time 
%str2=num2str(tmp(4,2));       % starting time 
[dat,tit,info,p]=clobjget('datw'); 
str1=num2str(p(2,1));  %%%add.';' 3/9/98     % sampling time 
str2=num2str(p(2,2));  %%%add.';' 3/9/98     % starting time 
%%%%%%%%%%%%%%%%%%%%%%end correction 
 
if iduifile('test1',str1,'tsamp');return,end 
if iduifile('test1',str2,'startt');return,end 
data_info=str2mat(str1,int2str(ny),str2,... 
   int2str(Nny),int2str(nu),nystr,nustr); 
if ~isempty(data_d) 
   data_info=str2mat(data_info,data_d); 
   data_infov=str2mat(data_info,data_dv); 
end 
% 
loadcom=[' ',data_n,'=[[',out_n,'],[ ',inp_n,']];']; 
strload=str2mat([],loadcom); 
data_info=str2mat(data_info,strload,['% Import  ',data_n]); 
axh=iduiinsd([y u],data_info,data_n); 
idinseva(axh,'seles'); 
% 
% Addition 11- and 16-09-1998 
% Copying data not only to working data but also to validation data: 
if CLIDmods(58,1)==CLIDmods(59,1) %% Check if data sets are different 
  idinseva(axh,'selva'); 
else 
  loadcom=[' ',data_nv,'=[[',out_nv,'],[ ',inp_nv,']];']; 
  strload=str2mat([],loadcom); 
  data_infov=str2mat(data_infov,strload,['% Import  ',data_nv]); 
  axh=iduiinsd([yv uv],data_infov,data_nv); 
  idinseva(axh,'selva'); 
end