|
Contents | Previous | Next | Subchapters |
function it is
interpreted as a function.
Otherwise it is interpreted as a script
.
The syntax for defining a function in Mlmode
is similar to the
multiple return
syntax in O-Matrix mode with the exception
that the local option is not available
and if there is only one return variable,
it need not be enclosed in brackets.
To be specific, the possible forms for a function definition are
function variable = name ( arguments ) statement list EOF
function [ variables ] = name ( arguments ) statement list EOF
where the function keyword is a the beginning of the file
and EOF denotes the end of the file.
temp.m in the
current working directory
contains the text
function y = temp(x)
y = 2 * x;
and you enter
mlmode
temp(3)
O-Matrix will respond
6