Here is an example for defining and using an anonymous function in Matlab
data = 1:10; %# A vector of data f = @(x) x.^2; %# An anonymous function squaredData = f(data); %# Invoke the anonymous function
An anonymous function has the name f . So why is it called anonymous?
f
An anonymous function is the expression @(x) x.^2 . This expression is a function that is unnamed and therefore anonymous. However, the value of f contains an expression. But the function itself can be used without a name.
@(x) x.^2
No, an anonymous function has no name.
There is a handle that is stored in a variable called f . The handle is not a function, although it can be used to call a function.
Source: https://habr.com/ru/post/1397679/More articles:Limiting queue length using PyZMQ - pythonhow to use bitwise mysql operations in php? - phpHow to use readlink with dynamic memory allocation - cAmazon S3 Error - Failed to establish trust for SSL / TLS secure channel - c #How to horizontally align columns in a table - htmlResize Chrome-style input using pure css - cssSpan attribute for colgroup and col - htmlHow to enter property dependencies on .net attribute? - c #How to select a random image from files in a directory using typoscript? - typo3jQuery trigger fails after cloning - javascriptAll Articles