[tri_x tri_y] = meshgrid(-1:.5:1);
tri_x = tri_x(:);
tri_y = tri_y(:);
dt = DelaunayTri(tri_x,tri_y);
vertexNumber = 13;
t = vertexAttachments(dt,vertexNumber);
fprintf('Simplices attached to vertex %i: ',vertexNumber)
disp(t{1})
triplot(dt);
hold on
vxlabels = arrayfun(@(n) {sprintf('P%d', n)}, (1:25)');
Hpl = text(tri_x, tri_y, vxlabels, 'FontWeight', 'bold', 'HorizontalAlignment',...
'center', 'BackgroundColor', 'none');
ic = incenters(dt);
numtri = size(dt,1);
trilabels = arrayfun(@(x) {sprintf('T%d', x)}, (1:numtri)');
Htl = text(ic(:,1), ic(:,2), trilabels, 'FontWeight', 'bold', ...
'HorizontalAlignment', 'center', 'Color', 'blue');
triplot(dt(t{:},:),tri_x,tri_y,'Color','r')
hold off
axis off
Best Answer