what is the purpose of the @ symbol in front of a

2020-07-06 02:10发布

问题:

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.

回答1:

@ prefixes the definition of an anonymous function.



回答2:

Also, @ is used to demark a function handle.