www.pudn.com > Closid30.rar > CLSAVSES.M, change:1998-10-22,size:1595b


function clsavses 
 
% Matlab function to save a CLOSID identification session. 
 
% 01-11-1996 
% (c) Edwin van Donkelaar, Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 05-06-1997. 
%              15-09-1998: Adapted storage of parametric model indicator 
%              22-10-1998: minor correction. 
global CLIDmods 
 
% Save models  
totmod=sum(CLIDmods(8,:)); 
models=find(CLIDmods(8,:)==1); 
 
for i=1:totmod 
 eval(['mod',num2str(i),'=get(CLIDmods(11,models(i)),''userdata'');']); 
 eval(['mtext',num2str(i),'=get(CLIDmods(10,models(i)),''string'');']); 
 eval(['mparam',num2str(i),'=CLIDmods(57,models(i));']); 
end 
 
% Save data sets 
totdat=sum(CLIDmods(3,:)); 
datasets=find(CLIDmods(3,:)==1); 
 
for i=1:totdat 
 eval(['data',num2str(i),'=get(CLIDmods(6,datasets(i)),''userdata'');']); 
 eval(['dtext',num2str(i),'=get(CLIDmods(5,datasets(i)),''string'');']); 
 eval(['dinfo',num2str(i),'=get(CLIDmods(5,datasets(i)),''userdata'');']); 
 eval(['datp',num2str(i),'=get(CLIDmods(4,datasets(i)),''userdata'');']); 
end 
 
% Save controllers 
 
totcon=sum(CLIDmods(18,:)); 
cons=find(CLIDmods(18,:)==1); 
 
for i=1:totcon 
 eval(['con',num2str(i),'=get(CLIDmods(21,cons(i)),''userdata'');']); 
 eval(['ctext',num2str(i),'=get(CLIDmods(20,cons(i)),''string'');']); 
end 
 
% Save working and validation data set 
eval(['wdatnum=CLIDmods(58,1);']); 
eval(['vdatnum=CLIDmods(59,1);']); 
 
% Save session 
clear i CLIDmods 
[filestr,pathstr]=uiputfile('*.cls'); 
if filestr~=0 
 eval(['save ',pathstr,filestr]) 
end