www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@contwostage/getConstraintFitOptions.m

    function [opts, ok] = getConstraintFitOptions(con)
%GETCONSTRAINTFITOPTIONS Get the options for fit a constraint to data
%
%  OPTS = GETCONSTRAINTFITOPTIONS(CON)
%
%  This method returns OPTS = [] and indicates that CON does not support
%  constraint fitting part of the fitting process. This does not necessarily
%  mean that a constraint does support fitting to data, but just that the third
%  step, i.e., FITCONSTRAINT, is not supported. It is possible that the
%  constraint maybe fitted to data via special or boundary points. Sub-classes
%  of CONBASE that require the "constraint fit" need to overload this method to
%  return an appropriate set of options.
%
%  See also CONBASE, CONBASE/GETSPECIALPOINTOPTIONS,
%    CONBASE/GETBOUNDARYPOINTOPTIONS, CONBASE/FITCONSTRAINT.

%  Copyright 2005 The MathWorks, Inc.

GUI_SETABLE = true;

% Second return argument is required to work with "xregoptmgr" code.
ok = true;

% Options for fitting the local constraint
conOpts = getConstraintFitOptions( con.Local );

% Options for the fitting the global models that join the local models
modelOpts = pGetGlobalModelFitOptions( con );

% Combine the options together
% -- Use an "optimisation manager" to handle the options
opts = contextimplementation( xregoptmgr, con, '', '', 'Constraint Fitting', @getConstraintFitOptions );

opts = AddOption( opts, 'LocalConstraintOptions',  conOpts,   class( conOpts   ), 'Local Constraint Fit', ~isempty( conOpts ) );
opts = AddOption( opts, 'GlobalModelOptions',      modelOpts, class( modelOpts ), 'Global Model Fit',     GUI_SETABLE );

%--------------------------------------------------------------------------
% EOF
%--------------------------------------------------------------------------