| MATLAB Function Reference | ![]() |
Syntax
msg=nargchk(low,high,number)
Description
The nargchk 函式通常用來M檔案中來檢查是否傳入正確數量的引數。
msg = nargchk(low,high,number)
若 number 的值低於 low 或高於 high時會回傳錯誤訊息。若在 low
和 high 之間(包括low和high的值), nargchk 回傳空矩陣。
Arguments
low, high |
輸入引數應傳入的最小和最大數量。 |
number |
引數的實際傳入數量,可使用 nargin。 |
Examples
function f = foo(x,y,z) error(nargchk(2,3,nargin))
Not enough input arguments.
See Also
| NaN | nargin, nargout | ![]() |