Why are anonymous Matlab functions called anonymous?

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?

+4
source share
2 answers

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.

+6
source

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.

0
source

Source: https://habr.com/ru/post/1397679/


All Articles