This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


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.




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.


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))))
+-- a
+-- _mult
|   |
|   +-- b
|   |
|   `-- 2
`-- _mult
    +-- d
    +-- _plus
    |   |
    |   +-- a
    |   |
    |   `-- c
    `-- -1



Expression to convert

Return Values


See Also

MuPAD Functions

Was this topic helpful?