function msg = nargchk(low,high,n,opt)
%MATLAB Code Generation Library Function

%   Limitations:  Struct output does not include stack information.

%   Copyright 1984-2015 The MathWorks, Inc.
%#codegen

eml_invariant(nargin >= 3, ...
    'MATLAB:minrhs');
eml_invariant(eml_is_const(low) && eml_is_const(high) && eml_is_const(n) && ...
    (nargin < 4 || eml_is_const(opt)), ...
    'Coder:toolbox:nargchk_2', ...
    'IfNotConst','Fail');
eml_invariant(nargin < 4 || (strcmp(opt,'string') || strcmp(opt,'struct')), ...
    'Coder:toolbox:nargchk_3', ...
    'IfNotConst','Fail');
eml_invariant(isscalar(low) && isscalar(high) && isscalar(n), ...
    'Coder:toolbox:nargchk_4', ...
    'IfNotConst','Fail');
eml_invariant(coder.internal.isBuiltInNumeric(low) && coder.internal.isBuiltInNumeric(high) && coder.internal.isBuiltInNumeric(n), ...
    'Coder:toolbox:nargchk_5', ...
    'IfNotConst','Fail');
eml_invariant(low == floor(low) && high == floor(high) && n == floor(n), ...
    'Coder:toolbox:nargchk_6', ...
    'IfNotConst','Fail');
if n < low
    if nargin < 4 || strcmp(opt,'string')
        msg = 'Not enough input arguments.';
    else
        msg.message = 'Not enough input arguments.';
        msg.identifier = 'MATLAB:narginchk:notEnoughInputs';
    end
elseif n > high
    if nargin < 4 || strcmp(opt,'string')
        msg = 'Too many input arguments.';
    else
        msg.message = 'Too many input arguments.';
        msg.identifier = 'MATLAB:narginchk:tooManyInputs';
    end
else
    msg = [];
end