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