This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getmatrix (phytree)

Convert phytree object into relationship matrix


[Matrix, ID, Distances] = getmatrix(PhytreeObj)


PhytreeObjphytree object created by phytree (object constructor).


[Matrix, ID, Distances] = getmatrix(PhytreeObj) converts a phytree object, PhytreeObj, into a logical sparse matrix, Matrix, in which 1 indicates that a branch node (row index) is connected to its child (column index). The child can be either another branch node or a leaf node. ID is a column vector of strings listing the labels that correspond to the rows and columns of Matrix, with the labels from 1 to Number of Leaves being the leaf nodes, then the labels from Number of Leaves + 1 to Number of Leaves + Number of Branches being the branch nodes, and the label for the last branch node also being the root node. Distances is a column vector with one entry for every nonzero entry in Matrix traversed column-wise and representing the distance between the branch node and the child.


 T = phytreeread('pf00002.tree')
 [MATRIX, ID, DIST] = getmatrix(T); 

More About

Introduced in R2006b

Was this topic helpful?