www.pudn.com > Closid30.rar > CLSAVE.M, change:1997-04-30,size:1265b


function clsave(option) 
% clsave(option) 
% 
% Saves settings or active axes objects in the main window. 
 
% 21-06-1996 
% (c) Douwe de Vries, Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 30-04-1997 
 
global CLIDcols CLIDmods CLIDmodn 
 
if strcmp(option,'settings') 
   fname=which('startup'); 
   fname=fname(1:length(fname)-9); 
   fname=[fname 'clprefs']; 
   eval(['save ' fname ' CLIDcols']); 
elseif strcmp(option,'results') 
   savstr=[]; 
   for ix=1:size(CLIDmods,2) 
      cm=[1:CLIDmods(1,ix)]; 
      ro=(ix-1)*5; 
      ia=find(CLIDmods(ro+2,cm)==1); 
      if ~isempty(ia) 
         for k=ia 
            ks=num2str(k); 
            model=[cldebl(CLIDmodn(ix,:)) '_' ks]; 
            info=[model '_info']; 
            title=[model '_name']; 
            eval([model '=get(CLIDmods(ro+6,k),''Userdata'');']); 
            eval([title '=get(CLIDmods(ro+5,k),''String'');']); 
            eval([info '=get(CLIDmods(ro+5,k),''Userdata'');']); 
            savstr=[savstr ' ' model ' ' info ' ' title]; 
         end 
      end 
   end 
   fname='cl_res'; 
   disp(['results save in file ' fname]); 
   eval(['save ' fname savstr]); 
else 
   error('not a valid option') 
end