Main Content

isEdge

(Not recommended) Test if vertices are joined by edge

isEdge(TriRep) is not recommended. Use isConnected(triangulation) instead.

TriRep is not recommended. Use triangulation instead.

Description

TF = isEdge(TR,V1,V2) returns an array of 1/0 (true/false) flags, where each entry TF(i) is true if V1(i), V2(i) is an edge in the triangulation.

example

TF = isEdge(TR,EDGE) specifies the edge start and end indices in matrix format.

Examples

collapse all

Load a 2-D triangulation and use TriRep to query the presence of an edge between pairs of points.

load trimesh2d
trep = TriRep(tri,x,y);

Test if vertices 3 and 117 are connected by an edge.

isEdge(trep,3,117)
ans = logical
   1

Test if vertices 3 and 164 are connected by an edge.

isEdge(trep,3,164)
ans = logical
   0

Create a 3-D Delaunay triangulation using DelaunayTri.

X = rand(10,3);
dt = DelaunayTri(X);

Test whether vertices 2 and 7 are connected by an edge.

isEdge(dt,2,7)
ans = logical
   0

Input Arguments

collapse all

Triangulation representation, specified as a TriRep or DelaunayTri object.

Indices of edge vertices, specified as column vectors. V1 and V2 represent the indices of the vertices in the mesh, that is, indices into the vertex coordinate arrays.

Indices of edge vertices, specified as a matrix. EDGE is n-by-2, where n is the number of query edges.

Version History

Introduced in R2009a