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

2

11

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.

Carniola answered 18/8, 2014 at 0:49 Comment(0)
N
5

@ prefixes the definition of an anonymous function.

Nordgren answered 18/8, 2014 at 1:8 Comment(0)
K
1

Also, @ is used to demark a function handle.

Kei answered 13/5, 2017 at 9:55 Comment(2)
Not in this context. -1Nordgren
There is a mismatch between the question title and the contextual example given, being the lack of parentheses in the title. This answer does, in fact, address a possible answer for the title as written. Perhaps an update to reflect this by someone would help solve the ambiguity.Perilune

© 2022 - 2024 — McMap. All rights reserved.