Function Reference
— Function File: msgstr = nargoutchk (minargs, maxargs, nargs)
— Function File: msgstr = nargoutchk (minargs, maxargs, nargs, "string")
— Function File: msgstruct = nargoutchk (minargs, maxargs, nargs, "struct")

Return an appropriate error message string (or structure) if the number of outputs requested is invalid.

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