www.pudn.com > Closid30.rar > Sitb2cl.m, change:1998-05-19,size:1305b


function [err,model,model_info,model_name]=sitb2cl 
% [err,model,model_info,model_name]=sitb2cl 
% 
% Gets one highlighted model from the model board in 
% Ljung's SITB. 
% 
% model = model in theta-format 
 
% 14-06-1996 
% (c) Douwe de Vries, Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 19-05-1998 
 
global XIDsumb 
 
err=1; 
model=0; 
model_info=0; 
model_name=0; 
 
sumb=findobj(get(0,'children'),'flat','tag','sitb30'); 
mods=findobj([XIDsumb(1);sumb(:)],'tag','modelline'); 
linh=findobj(mods,'flat','linewidth',3); 
if isempty(linh) 
   clerrdia([' ERROR COPYING MODEL: No models selected, click '... 
             ' on model icons in the SITB model board to select'... 
             ' the desired one.                               '],1) 
   return 
elseif length(linh)>1 
   clerrdia([' ERROR COPYING MODEL: Multiple models selected,'... 
             ' click on model icons the SITB model board to'... 
             ' deselect the undesired ones. Multiple models  '... 
             ' can only be copied successively.              '],1) 
   return 
end 
 
axsh=get(linh,'parent'); 
texh=findobj(axsh,'tag','name'); 
model=get(linh,'UserData'); 
model_name=get(texh,'String'); 
model_info=get(texh,'UserData'); 
err=0;