This is a powerful and useful tool. It is well written and documented.
Since Mathworks abandoned tsearch, simply calling tsearchn instead works for me. Moving to tsearchn requires two changes that I am aware of:
mytesearch.m Line 68:
i(j)=tsearchn([x y],t,[xi(j) yi(j)]);
meshfaces.m Line 199:
i = tsearchn(ph,th,p);
I do not agree with the solution proposed by Chen and Barnhart. Delaunay triangulations are not unique. Their approach effectively generates a separate triangulation and searches over it. Mapping such results into the original Mesh2D triangulation is ill-advised.
One more fix. In quadtree.m, near line 528 (right before %Undo rotation, p=rotate(p,-theta)), add:
% remove duplicate nodes
So that's three places to fix with the comments below:
meshfaces.m, line 203
mytsearch.m, line 69
quadtree.m, line 528 (or thereabouts)