Find descendants of a node in biograph object
Nodes
=
getdescendants(BiographNode
)
Nodes
=
getdescendants(BiographNode,NumGenerations
)
| Node in a biograph object. |
| Number of generations. Enter a positive integer. |
finds
a given node (Nodes
=
getdescendants(BiographNode
)BiographNode
) all of its
direct descendants.
finds
the node (Nodes
=
getdescendants(BiographNode,NumGenerations
)BiographNode
) and all of its
direct descendants up to a specified number of generations (NumGenerations
).
If the NumGenerations
is 0
,
the function returns the node itself.
Create a biograph object.
cm = [0 1 1 0 0;1 0 0 1 1;1 0 0 0 0;0 0 0 0 1;1 0 1 0 0]; bg = biograph(cm)
Find one generation of descendants for node 4.
desNodes = getdescendants(bg.nodes(4)); set(desNodes,'Color',[1 .7 .7]); bg.view;
Find two generations of descendants for node 4.
desNodes = getdescendants(bg.nodes(4),2); set(desNodes,'Color',[.7 1 .7]); bg.view;
biograph
| dolayout
| get
| getancestors
| getdescendants
| getedgesbynodeid
| getnodesbyid
| getrelatives
| set
| view