Documentation

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 (biograph)

Get connection matrix from biograph object

Syntax

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

Arguments

BGObjBiograph object created by biograph (object constructor).

Description

[Matrix, ID, Distances] = getmatrix(BGObj) converts the biograph object, BiographObj, into a logical sparse matrix, Matrix, in which 1 indicates that a node (row index) is connected to another node (column index). ID is a cell array of character vectors listing the ID properties for each node, and corresponds to the rows and columns of Matrix. Distances is a column vector with one entry for every nonzero entry in Matrix traversed column-wise and representing the respective Weight property for each edge.

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, dist] = getmatrix(bg)
 

More About

Introduced in R2006b

Was this topic helpful?