Documentation Center

  • Trial Software
  • Product Updates

prog::exprlist

Convert an expression into a nested list

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

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?