您的位置:首页 > 编程语言 > MATLAB

MATLAB的iptchecknargin函数详解!

2016-05-03 14:40 896 查看
欢迎大家加入图像识别技术交流群:271891601,另外,特别欢迎成都从事图像识别工作的朋友交流,我的QQ号2487872782

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. ..........更多的自己去翻看文档吧!这句话已经说清楚了功能!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: