How to do Delaunay Triangulation and return an adjacency matrix?
Show older comments
I want to get back Adjacency Matrix from Delaunay Triangulised object...How to do .....
Accepted Answer
More Answers (1)
Akira Agata
on 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';
Categories
Find more on Triangulations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!