Information about reserved identifiers
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
prog::isGlobal(ident) checks whether the
ident is “used by the system”.
Here, “used by the system” means that
an environment variable (e.g.,
PRETTYPRINT), a system-wide
undefined), an option (for some function
All), or a system function (such as
The most of those identifiers are protected (see
Assume you would like to use some identifiers as options for
a new function you wrote. In this example, we will check the elements
of the list
[All, Beta, Circle, D, eval, First] for
suitability. (Note that
eval would not be a good
choice, even if it was not a system function, because options should
start with a capital letter.)
LIST:= [All, Beta, Circle, D, eval, First]: map(LIST, X -> if domtype(X) <> DOM_IDENT then X = FAIL else X = prog::isGlobal(X) end_if)
be used as options because they have already been protected by the
system (actually, they are already used as options, which makes them
a good choice), the identifiers
free and one must only take care that they have no value if they will
be used as options—they should be protected first.
values and cannot be used as options.
Identifier to check
if the given identifier is used by the system, otherwise