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?

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
Yin Zhu
  • 16,980
  • 13
  • 75
  • 117

3 Answers3

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.

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.

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
Royi
  • 4,640
  • 6
  • 46
  • 64
  • Actually, it is called a function handle (not handler) using similar naming convention as graphics objects also have 'handles'. – MatlabDoug Jan 20 '10 at 16:41
2

Documentation says that it's a function handle.

raimue
  • 4,322
  • 1
  • 21
  • 31
Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288