/usr/share/freemat/help/text/anonymous.mdc is in freemat-help 4.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ANONYMOUS ANONYMOUS Anonymous Functions
Usage
Anonymous functions are simple, nameless functions that can be defined
anywhere (in a script, function, or at the prompt). They are intended
to supplant inline functions. The syntax for an anonymous function
is simple:
y = @(arg1,arg2,...,argn) expression
where arg1,arg2,...,argn is a list of valid identifiers that define
the arguments to the function, and expression is the expression to
compute in the function. The returned value y is a function handle
for the anonymous function that can then be used to evaluate the expression.
Note that y will capture the value of variables that are not indicated
in the argument list from the current scope or workspace at the time
it is defined. So, for example, consider the simple anonymous function
definition
y = @(x) a*(x+b)
In order for this definition to work, the variables a and b need to
be defined in the current workspace. Whatever value they have is captured
in the function handle y. To change the values of a and b in the
anonymous function, you must recreate the handle using another call. See
the examples section for more information. In order to use the anonymous
function, you can use it just like any other function handle. For example,
p = y(3)
p = y()
p = feval(y,3)
are all examples of using the y anonymous function to perform a calculation.
|