getweightmatrix (biograph)

Get connection matrix with weights from biograph object

Syntax

[Matrix, ID] = getweightmatrix(BGObj)

Arguments

BGObj Biograph object created by biograph (object constructor).

Description

[Matrix, ID] = getweightmatrix(BGObj) 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). ID is a list of the node's 'ID' property and corresponds to the rows and columns of Matrix.

Examples

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); 
Introduced in R2006b