What is the @ operator in MATLAB?

孤街浪徒 提交于 2019-11-26 08:27:48

问题


I\'ve only used MATLAB 6.5 before. I got some programs that is using \'@\'. Can someone tell me what is it?

By the way, does MATLAB 6.5 support this operator?


回答1:


The @ operator creates a function handle, something that allows you to easily create and pass around a function call like a variable. It has many nice features, none of which are available to you unfortunately. This is because as you suspect, it was not introduced into matlab until version 7, the release immediately after yours.




回答2:


It used to declare Anonymous Functions in Matlab.

I think the terms is "Function Handle".

Practically it covers the inability of Matlab to declare a function at any place in any M file.

You may see it here: What is your favourite MATLAB/Octave programming trick?

I found it to be useful in Image Processing along with the "blockproc" command.




回答3:


Documentation says that it's a function handle.



来源:https://stackoverflow.com/questions/2100595/what-is-the-operator-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!