f = nodepar(t,n)
returns a vector that contains the indices of the "parent(s)" of the nodes
n in the tree t. In the tree, nodes
are numbered from left to right and from top to bottom. The root index is 0.
Note
nodepar(t,0) or nodepar(t,[0 0])
returns -1.
f = nodepar(t,n,"deppos")
returns a matrix that contains the depths and positions of the "parent(s)" of the
nodes n in the tree t.
Note
nodepar(t,0,"deppos") or
nodepar(t,[0,0],"deppos") returns
[-1,0].
Tree, specified as an ntree, dtree,
or wptree object.
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.
Tree nodes, returned as a column vector or matrix. If
f is a vector, f contains node indices. If
f is matrix,
f(i,1) and
f(i,2) are the depth and
position, respectively, of the ith node.
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.