MATLAB: Triangulation within specified region

delaunay triangulationtriangulation

I am trying to triangulate a specified region along a 2d plane. The region i wish to tringualte is specified by x and y cooridantes and the lines joining each of these points. However when I use delaunyTriangulation it triangulates the entire region, including the parts I wish to leave out. I have inserted an image below.
Is there anyway to specify the boundary or region of which I would like to triangulate or remove the large unwated trinagles from the triangulation?
Thanks
untitled.jpg

Best Answer

Read about delaunayTriangulation , you can provide edge constraints. On providing these constraints; you can avoid such triangles.
DT = delaunayTriangulation(x,y,C)