How to do Delaunay Triangulation and return an adjacency matrix?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mohammad Bhat
am 25 Nov. 2017
Beantwortet: Christine Tobler
am 27 Nov. 2017
I want to get back Adjacency Matrix from Delaunay Triangulised object...How to do .....
0 Kommentare
Akzeptierte Antwort
Christine Tobler
am 27 Nov. 2017
If your goal in computing the adjacency matrix is to construct a graph object, you can also do that (a bit) more directly:
% Construct tri as in Akira's code above
g = digraph(tri, tri(:, [2 3 1]));
A = adjacency(g);
A = A | A';
g = graph(A);
plot(g)
0 Kommentare
Weitere Antworten (1)
Akira Agata
am 27 Nov. 2017
By using the output variable of delaunay function, you can create adjacency matrix like:
% N: Number of points
N = 8;
x = rand(N,1);
y = rand(N,1);
% Delaunay triangulation
tri = delaunay(x,y);
% Calculate adjacency matrix
AdjMat = false(N);
for kk = 1:size(tri,1)
AdjMat(tri(kk,1), tri(kk,2)) = true;
AdjMat(tri(kk,2), tri(kk,3)) = true;
AdjMat(tri(kk,3), tri(kk,1)) = true;
end
AdjMat = AdjMat | AdjMat';
0 Kommentare
Siehe auch
Kategorien
Mehr zu Delaunay Triangulation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!