Find relatives of a node in biograph object
Nodes
=
getrelatives(BiographNode
)
Nodes
=
getrelatives(BiographNode,NumGenerations
)
| Node in a biograph object. |
| Number of generations. Enter a positive integer. |
finds
all the direct relatives for a given node (Nodes
=
getrelatives(BiographNode
)BiographNode
).
finds
the direct relatives for a given node (Nodes
=
getrelatives(BiographNode,NumGenerations
)BiographNode
)
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 all nodes interacting with node 1
.
intNodes = getrelatives(bg.nodes(1)); set(intNodes,'Color',[.7 .7 1]); bg.view;
biograph
| dolayout
| get
| getancestors
| getdescendants
| getedgesbynodeid
| getnodesbyid
| getrelatives
| set
| view