Compute Topological Similarity matrix


Updated 16 May 2017

View License


T = getTopologicalSimilarity(W,g,m)

Compute the Topological Similarity matrix T from the structural network
defined by matrix W. T quantifies how similar are the whole-network influence
received by two distinct nodes through all paths of every length. It is imple-
mented as a quantification of the similarity between all pairs of column vectors of
the communicability matrix Qexp, and as such can be computed using any n-dimen-
sional measure of similarity. The present code allows you to choose to compute
the topological similarity matrix T using either the (1) cosine similarity,
(2) Pearson correlation coefficient or (3) Euclidean distance. Choose the prefer-
red method having in mind their differences, characteristics and limitations.
NOTE: the code calls 'getEucliDist.m'


W : n-by-n matrix (cab be weighted, unweighted, directed or undirected)
g : global coupling factor (default is 1)
m : compute T either using:

m = 1, cosine similarity (default)
m = 2, Pearson Ccrrelation coefficient
m = 3, Euclidean distance


T : Topological Similarity matrix (n-by-n)


- Bettinardi, R.G., Deco, G., Karlaftis, V.M., Van Hartevelt, T.J., Fernandes, H.M., Kourtzi, Z., Kringelbach, M.L. & Zamora-López, G.
(2017). “How structure sculpts function: Unveiling the contribution of anatomical connectivity to the brain's spontaneous
correlation structure.” Special Issue: On the relation of dynamics and structure in brain networks. Chaos: An
Interdisciplinary Journal of Nonlinear Science, 27(4), 047409. DOI:

Cite As

Ruggero G. Bettinardi (2023). getTopologicalSimilarity(W,g,m) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes