TSTOOL home page | TSTOOL documentation page | TSTOOL installation page | TSTOOL link page

Next: 4.4.2 nn_search Up: 4.4 Matlab mex-functions Previous: 4.4 Matlab mex-functions

## 4.4.1 nn_prepare

`nn_prepare` does the preprocessing for a given data set pointset. The returned data structure atria contains preprocessing information that is necessary to use `nn_search` or `range_search`.

Preprocessing and searching is divided into different mex-files to give the user the possibility to re-use the preprocessing data (contained in atria) when doing multiple searches on the same point set. However, as soon as the underlying point set is changed or modified, one has to recompute atria for the changed point set.

Syntax:

-      atria = nn_prepare(pointset)

-      atria = nn_prepare(pointset, metric)

-      atria = nn_prepare(pointset, metric, clustersize)

Input arguments:

- pointset - a N by D double matrix containing the coordinates of the point set, organized as N points of dimension D
- metric - (optional) either 'euclidian' or 'maximum' (default is 'euclidian')
- clustersize - (optional) threshold for clustering algorithm, defaults to 64