Documentation

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.

prog::exprlist

Convert an expression into a nested list

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.

Syntax

prog::exprlist(ex)

Description

prog::exprlist returns a list that contains all operands of the expression ex. Each operand of type DOM_EXPR is converted into a list, too.

The return value of prog::exprlist can be used directly as argument for adt::Tree resp. output::tree.

Examples

Example 1

The example shows the nested list for the expression a + b*2 - d*(a + c):

prog::exprlist(a + b*2 - d*(a + c))

The return value can be used to create and display a tree:

expose(adt::Tree(prog::exprlist(a + b*2 - d*(a + c))))
_plus
|
+-- a
|
+-- _mult
|   |
|   +-- b
|   |
|   `-- 2
|
`-- _mult
    |
    +-- d
    |
    +-- _plus
    |   |
    |   +-- a
    |   |
    |   `-- c
    |
    `-- -1

Parameters

ex

Expression to convert

Return Values

List

See Also

MuPAD Functions

Was this topic helpful?