Get connection matrix with weights from biograph object
[
Matrix, ID
] = getweightmatrix(BGObj
)
BGObj | Biograph object created by biograph (object constructor). |
[
converts
the biograph object into a double sparse matrix, where non-zeros indicate
the weight from the source node (row index) to the destination node
(column index). Matrix, ID
] = getweightmatrix(BGObj
)ID
is a list of the node's 'ID'
property
and corresponds to the rows and columns of Matrix
.
cm = [0 1 1 0 0;2 0 0 4 4;4 0 0 0 0;0 0 0 0 2;4 0 5 0 0]; bg = biograph(cm); [cm,IDs] = getweightmatrix(bg);
biograph
| dolayout
| getancestors
| getdescendants
| getedgesbynodeid
| getnodesbyid
| getrelatives
| view