https://www.mathworks.com/help/matlab/ref/nargchk.html
nargchk - Validate number of input arguments - MATLAB
This MATLAB function validates the number of input arguments and returns a message if the number of inputs, numArgs, is fewer than minArgs or greater than...
validatenumberinputargumentsmatlab