フィルターのクリア

Invalid Distance argument, must be a character string (kDtreeSearcher)

1 回表示 (過去 30 日間)
jiji hr
jiji hr 2017 年 3 月 21 日
I am working on 3D points cloud with Matlab, and I want to compute the minimum distance of each point on an object X to all points on an other object Y.
To achieve this, I have constructed a kDtree for X and defined my own distance function Dist6D.m. Then using the knnsearch algorithm, I do this:
[match mindist] = knnsearch(kdOBJ,transpose(Y),'Distance',@Dist6D);
The problem I encounter is that it redirects me to the file
toolbox/stats/stats/KDTreeSearcher/knnsearch
and I can't define my own function. The only permitted functions are defined as strings and it doesn't allow me to use my own. in the description they wrote this :
% 'Distance' A string specifying the distance metric. The value can
% be one of the following:
% 'euclidean' - Euclidean distance
% 'cityblock' - City Block distance
% 'chebychev' - Chebychev distance (maximum
% coordinate difference)
% 'minkowski' - Minkowski distance
% Default is NS.Distance end
Lastly, I am obliged to use a kDtreeObject (Because using just X and Y without transforming one oh them to a Kdtree Obj solves the problem for me).

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by