KDTreeSearcher
Nearest neighbor searcher object.
📝Syntax
Mdl = KDTreeSearcher(X)
Mdl = KDTreeSearcher(X, Name, Value)
[idx, D] = knnsearch(Mdl, Y, Name, Value)
[idx, D] = rangesearch(Mdl, Y, radius, Name, Value)
📥Input Arguments
Parameter Description
X the data to search, as a real numeric matrix with one point per row.
Name, Value options: Distance (default 'euclidean'), P (Minkowski exponent) and BucketSize.
📤Output Arguments
Parameter Description
Mdl a KDTreeSearcher object holding the data and the search options.
📄Description

KDTreeSearcher stores a set of points and the distance metric used to query them, so that nearest neighbor searches can be run against the same data with knnsearch and rangesearch. The object exposes the properties X, Distance, DistParameter and BucketSize.

The searches delegate to the knnsearch and rangesearch functions, forwarding the distance metric stored on the object.

💡Examples
X = [0 0; 1 0; 0 2; 4 4];
Mdl = KDTreeSearcher(X);
[idx, D] = knnsearch(Mdl, [0 1; 3 4], 'K', 2)
🔗See Also
knnsearchrangesearch
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub