Function Reference
— Function File: nargchk (nargin_min, nargin_max, n)

If n is in the range nargin_min through nargin_max inclusive, return the empty matrix. Otherwise, return a message indicating whether n is too large or too small.

This is useful for checking to see that the number of arguments supplied to a function is within an acceptable range.