Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

treelayout (MathScript RT Module Function)

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

Owning Class: geometry

Requires: MathScript RT Module

Syntax

[x, y] = treelayout(p)

[x, y, h] = treelayout(p)

Description

Calculates the layout of a tree or a forest. A forest is a set of independent trees. You can use the treeplot function to generate a plot for a tree or a forest.

Examples

Inputs

Name Description
p Specifies the information of a tree or a forest. If p(i) is 0, node i is a root. If p(i) is j, node i is one of the children of node j.

Outputs

Name Description
x Returns the x-coordinate of each node.
y Returns the y-coordinate of each node.
h Returns the height of p.

Examples

p = [0, 4, 5, 10, 0, 10, 3, 4, 5, 1, 3];
treeplot(p)
[x, y, h] = treelayout(p)

Related Topics

treeplot


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit