www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgoptimdataset/checkAppPointSetup.m

    function [status, msg] = checkAppPointSetup(DS, optim)
%CHECKAPPPOINTSETUP Check the Application Point Set configuration.
%
%   [STATUS, MSG] = CHECKAPPPOINTSETUP(DS, OPTIM) checks whether the
%   overall settings for application point sets are valid and returns a
%   single status code and message string to indicate any problems.
%
%   A status of 0 indicates no problem, 1 indicates a warning issue and 2
%   indicates an critical problem.  MSG is string that describes the
%   problem and will be non-empty when the status is not zero.

%   Copyright 2009 The MathWorks, Inc.

status = 0;
msg = '';
HasAppPoints = isAppPointOptim(DS);
if HasAppPoints
    if ~isSumProblem(optim)
        % must be a sum problem
        status = 2;
        msg = 'Application point sets can only be used with sum optimizations.';
        return
    end
    
    if ~isempty(DS.OpPointVariables) && ~all(ismember(DS.OpPointVariables,getfixedvalues(optim)))
        % operating point variables must be fixed variables
        status = 2;
        msg = 'All operating point variables must be fixed variables.';
        return
    end
    
    % fit thinplate spline interpolant to operating point variables
    [status,msg]= checkInterpolation(DS,optim);
end