odnerpmocon
odnerpmocon

Reputation: 282

What to use instead of the dsearch function in MATLAB?

I'm looking at an old code in MATLAB, which I want to modify. The issue is, the code contains the function dsearch, which as far as I understand has been discontinued. Is there a function that can replace it? If not, what code should I write to make it do the same thing as dsearch?

Upvotes: 1

Views: 544

Answers (1)

Connor
Connor

Reputation: 11

Use dsearchn. As suggested by Mike (23-Sep-2013) in the comments thread for Darren Engwirda's MESH2D, tsearch can be replaced by tsearchn. Likewise, dsearch can be replaced by dsearchn.

Note that a slight change in usage is required. dsearch works only for 2D triangulations, while dsearchn works for n-dimensional triangulations. Therefore, instead of

k = dsearch(x, y, t, xi, yi);

you should use

k = dsearchn( [x,y], t, [xi, yi] );

Upvotes: 1

Related Questions