I see this was asked a while ago, but in case you're still interested, here's something to try:
First extract the values above the diagonal from the adjacency matrix, like so:
>> matY = [];
>> for n = 2:6
for m = n:6
matY = [matY mat(n,m)];
end
end
>> matY
matY =
Columns 1 through 13
0 0 0 1 0 0 1 0 0 0 0 1 0
Columns 14 through 15
0 0
Now you have something that looks like the Y
vector pdist
would have produced. But the values here are the opposite of what you probably want; the unconnected vertices have a "distance" of zero and the connected ones are one apart. Let's fix that:
>> matY(matY == 0) = 10
matY =
Columns 1 through 13
10 10 10 1 10 10 1 10 10 10 10 1 10
Columns 14 through 15
10 10
Better. Now we can compute a regular cluster tree, which will represent connected vertices as "close together" and non-connected ones as "far apart":
>> linkage(matY)
ans =
3 6 1
1 5 1
2 4 1
7 8 10
9 10 10
>> dendrogram(ans)
The resulting diagram:
Hope this is a decent approximation of what you're looking for.