function ExportData = exportdata(LoopData,ModelList)
%EXPORTDATA   Export SISO Tool models back to workspace.
%
%   See also SISOTOOL.

%   Author(s): P. Gahinet
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.9 $  $Date: 2000/06/14 20:18:26 $

% Give I/O names to the closed-loop model
clsys = LoopData.ClosedLoop;
set(clsys,'inputname',{'r','dy','du','n'},'outputname',{'y','u'});
LoopData.ClosedLoop = clsys;

% Grab models
ExportData = getmodels(LoopData,ModelList);

% Convert SISO models to ZPK
for ct=1:length(ModelList)
    if ~isa(ExportData{ct},'zpk') & issiso(ExportData{ct})
        ExportData{ct} = zpk(ExportData{ct});
    end
end
