This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Value of an object

MuPAD® notebooks are not recommended. 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.




val(object) replaces every identifier in object by its value.

val does not perform any simplification of the result.

If the result of val is a set, duplicate elements are removed from that set.

val does not work recursively, i.e., if the value of an identifier in turn contains identifiers, then these are not replaced by their values. See Example 3.

val does not flatten its argument. Hence, an expression sequence is accepted as argument. Cf. Example 2.


Example 1

val replaces identifiers by their values, but does not call arithmetical functions such as _plus:

a := 0: val(a*b + 4 + 0)

Duplicate elements in sets are removed:

a := b: val({a, b, a*0})

delete a:

Example 2

val does not flatten its argument, nor does it remove void objects of type DOM_NULL:

a := null(): val((a, null()))
 null(), null() 

However, it is not legal to pass several arguments:

val(a, null())
Error: The number of arguments is incorrect. [val]
delete a:

Example 3

val does not recursively substitute values for the identifiers:

delete a, b: a := b: b := c: val(a)



Any MuPAD® object

Return Values

"evaluated" object.

See Also

MuPAD Functions

Was this topic helpful?