Display of trees
This functionality does not run in MATLAB.
output::tree(Tree, <indentdepth, <charlist>, <Small>>)
output::tree displays trees given as specially MuPAD® lists.
The first object of the list is the root of the tree. All further objects are nodes or subtrees of the tree. A subtree is again a special list (as described), and any other MuPAD object will be interpreted as node of the tree.
The elements of the tree will be printed by MuPAD, when the tree will be displayed, so it's recommended to use strings as objects or objects with a well defined display.
The parameter charlist is a list with five characters. The default value is ["|", "+", "-", „", " "]. The characters have the following meaning (described in the order of the list).
The vertical lines of the tree, the connection between vertical and horizontal line (i.e., an arm, but not the last arm), an arm (vertical line), the last connection to an arm in a subtree, a char between an arm and the description of the arm.
output::tree displayes special nested lists as trees:
TREE := ["a1", "a2", ["b1", "b2", ["c1", "c2"], "b3"], ["d1", "d2", "d3"]]: print(Unquoted, output::tree(TREE))
a1 | +-- a2 | +-- b1 | | | +-- b2 | | | +-- c1 | | | | | `-- c2 | | | `-- b3 | `-- d1 | +-- d2 | `-- d3
print(Unquoted, output::tree(TREE, 3, Small)):
a1 +- a2 +- b1 | +- b2 | +- c1 | | `- c2 | `- b3 `- d1 +- d2 `- d3
The chars can be defined by the user:
print(Unquoted, output::tree(TREE, 6, ["|", "|", ".", "\\", " "])):
a1 | |.... a2 | |.... b1 | | | |.... b2 | | | |.... c1 | | | | | \.... c2 | | | \.... b3 | \.... d1 | |.... d2 | \.... d3
The tree, given as a special list
Indent depth for each subtree
The chars that illustrate the tree structure
Suppresses the display of a space line between every tree entry to reduce the height of the tree