What is the @ operator (at sign) in MATLAB?
Asked Answered
P

3

13

I have some MATLAB programs that use the @ (at sign) as an operator. What does it mean?

Does MATLAB 6.5 support this operator?

Polyhydroxy answered 20/1, 2010 at 10:24 Comment(0)
S
17

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.

Stahl answered 20/1, 2010 at 10:38 Comment(0)
U
8

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.

Unworthy answered 20/1, 2010 at 10:31 Comment(1)
Actually, it is called a function handle (not handler) using similar naming convention as graphics objects also have 'handles'.Disputatious
G
2

Documentation says that it's a function handle.

Gowen answered 20/1, 2010 at 10:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.