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

    function [Status, Message] = checkSetup(obj)
%CHECKINPUTSIZES Check the object's parameters
%
%  [STATUS, MESSAGE] = CHECKSETUP(OBJ) checks that the object's settings
%  are acceptable.  STATUS is an integer code that indicates whether that
%  input is acceptable.  A status of 0 indicates no problem, 1 indicates a
%  warning issue and 2 indicates an critical problem.  MESSAGE is a string
%  that describes the overall problem and should be non-empty whenever the
%  status code is greater than 0.

%   Copyright 2006-2009 The MathWorks, Inc.

if isempty(obj.pItem)
    Status = 2;
    Message = 'No variable has been selected';
elseif isempty(obj.pAxisVariables)
    Status = 1;
    Message = 'No table has been configured';
elseif ~isComplete(obj)
    Status = 2;
    Message = 'The constraint settings are not valid.';
else
    Status = 0;
    Message = '';
end