MATLAB的iptchecknargin函数详解!

图像处理开发资料、图像处理开发需求、图像处理接私活挣零花钱,可以搜索公众号"qxsf321",并关注!
图像处理开发资料、图像处理开发需求、图像处理接私活挣零花钱,可以搜索公众号"qxsf321",并关注!
图像处理开发资料、图像处理开发需求、图像处理接私活挣零花钱,可以搜索公众号"qxsf321",并关注!

iptchecknargin函数详解,这个函数在看别人写的M函数时很有用!

ipt是image process tools,即图像处理工具的缩写,MALAB里边有一个图像像处理工具箱,里边有一组函数的命名规则是在前面加上ipt

nargin是输入参数个数的意思,具体是怎么缩写而来的我不清楚

下面介绍查找其使用资料的方法!

首先在MATLAB的HELP中打开Product Help,然后搜索iptchecknargin,对这个函数的介绍就非常清楚了,我复制过来如下:

iptchecknargin
Check number of input arguments
Syntax
iptchecknargin(low, high, num_inputs, func_name)
Description
iptchecknargin(low, high, num_inputs, func_name) checks whether num_inputs is in the range indicated by low and high. If not, iptchecknargin issues a formatted error message.
low should be a scalar nonnegative integer.
high should be a scalar nonnegative integer or Inf.
func_name is a string that specifies the name used in the formatted error message to identify(指出,发现,识别) the function checking the handle.
Examples
iptchecknargin(1,3,nargin,mfilename);//mfilename是一个函数,会返回当前M文件的文件名

这里再搜索nargin,解释如下:

Nargin
Number of function arguments
Syntax
nargin
nargin(fun)
Description
In the body of a function, nargin indicates how many input arguments a user has supplied. ..........更多的自己去翻看文档吧!这句话已经说清楚了功能!

你可能感兴趣的:(MATLAB的基础与使用)