Main Content
nargchk
Validate number of input arguments
nargchk
is not recommended. Use narginchk
instead.
Syntax
Description
Examples
Input Arguments
Output Arguments
Tips
nargchk
is often used with theerror
function. Theerror
function accepts either type of return value fromnargchk
: a message character vector or message structure. For example, this command uses the output message structure fromnargchk
as the input to theerror
function.error(nargchk(2,4,nargin,'struct'))
If the number of input arguments is within the expected range, then
nargchk
returns an empty character vector or structure. When theerror
function receives an empty character vector or structure, it does not throw an error.
Extended Capabilities
Version History
Introduced before R2006a