matlab @ 什么意思

2020-07-08 教育 120阅读
@是个操作符,叫匿名函数操作符,这个符号很有用。
想详细了解这个,你在Command Window下输入 help @
就弹出很多的帮助资料,然后你点关于@的这行
punct - Function handle creation @
点开,有以下信息
@ At. The at symbol is used to create a function_handle.
It is also used at the beginning of directory names that contain
matlab object methods and the constructor for the object, e.g.
the directory @inline contains the constructor inline.m for the
inline object and all methods for inline objects.
所以你要去了解Function handle函数句柄。
于是你就help function_handle 注意有个下划线,简单地说函数句柄代表这个函数的名字,通过这个句柄你可以调用这个函数,让调用函数的操作异常简单,这个是MATLAB的神奇之处。我举个小例子,比如,在Command Window下输入以下
ezplot(@sin)
它就可以把sin函数画出来,可能现在你不是很理解这个,但你应该能体会到这个操作的强大。(你自己操作一遍就会有直观感受)
我这里只是抛砖引玉,MATLAB的帮助很强大,尽量自己去熟悉MATLAB的帮助。
加油~
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com