function option=makeoptionstruct(c,simparam,model)
%MAKEOPTIONSSTRUCT creates a structure to pass to the sim command

%   Copyright (c) 1997-2000 by The MathWorks, Inc.
%   $Revision: 1.3 $  $Date: 2000/03/23 19:37:48 $

if nargin<3
   model=c.zslmethods.Model;
   if nargin<2
      simparam=c.att.simparam;
   end
end

mdlName=openmodel(c,model);


if isempty(mdlName)
   option=simget;
else
   try
      option=simget(mdlName);
   catch
      option=simget;
   end
end

option=simset(option,simparam{:});