nodejoin
Recompose node
Syntax
Description
Examples
Recompose Binary Tree Node
Create a binary tree of depth 3.
ord = 2; t = ntree(ord,3);
Plot the tree.
fig = plot(t);
Programmatically, in Node Label, change the selected item from Depth_Position
to Index
.
plot(t,"setNodeLabel",fig,"Index")
Merge the nodes at indices 4 and 5. Plot the result.
t = nodejoin(t,5); t = nodejoin(t,4); fig = plot(t); plot(t,"setNodeLabel",fig,"Index")
Input Arguments
T
— Tree
ntree
object | dtree
object | wptree
object
Tree, specified as an ntree
, dtree
,
or wptree
object.
N
— Tree nodes
column vector | two-column matrix
Tree nodes, specified as a column vector that contains indices of the
nodes or a matrix that contains the depths and positions of the nodes. If
specified as a matrix, N(i,1)
and
N(i,2)
are the depth and
position, respectively, of the ith node.
The nodes are numbered from left to right and from top to bottom. The root index is 0.
Data Types: double
Version History
Introduced before R2006a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)