www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/mbcnargchk.m

    function S = mbcnargchk(low, high, number, component)
%MBCNARGCHK Validate number of input arguments. 
%   S = MBCNARGCHK(LOW, HIGH, N, COMPONENT) returns an appropriate error
%   message structure if N is not between low and high. 
%
%   See also NARGOUTCHK, NARGIN, NARGOUT, INPUTNAME.

%   Copyright 2004-2014 The MathWorks, Inc.

% This needs to wait until it's integrated into R14 where error accepts a
% struct input
if (number < low)
    S.message = 'Not enough input arguments.';
    S.identifier = [component ':NotEnoughInputs'];
elseif (number > high)
    S.message = 'Too many input arguments.';
    S.identifier = [component ':TooManyInputs'];
else
    S = struct('message', cell(0, 1), 'identifier', cell(0, 1));
end