Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the purpose of the @ symbol in front of a variable in octave?

For example:

model = svmTrain(X, y, C, @(x1, x2) gaussianKernel(x1, x2, sigma)); 

Disclaimer: This is from the Coursera ML class, but it's nearly impossible to search for the @ symbol conventionally.

like image 278
aman Avatar asked Aug 18 '14 00:08

aman


2 Answers

@ prefixes the definition of an anonymous function.

like image 107
David Foerster Avatar answered Nov 07 '22 18:11

David Foerster


Also, @ is used to demark a function handle.

like image 23
user7610 Avatar answered Nov 07 '22 18:11

user7610