Documentation

treelayout

Lay out tree or forest

Syntax

[x,y] = treelayout(parent,post)
[x,y,h,s] = treelayout(parent,post)

Description

[x,y] = treelayout(parent,post)列出了一棵树或者一个st.is the vector of parent pointers, with0for a root.postis an optional postorder permutation on the tree nodes. If you omitpost,treelayoutcomputes it.xandyare vectors of coordinates in the unit square at which to lay out the nodes of the tree to make a nice picture.

[x,y,h,s] = treelayout(parent,post)also returns the height of the treehand the number of verticessin the top-level separator.

Introduced before R2006a

Was this topic helpful?