I can't clearly understand that the matlab function: "Idx = knnsearch(X,Y)" searches for nearest neighbours. But what method it uses for search? I read default method is eucledain but I didn't input any method. I just used [Idx, b] = knnsearch(X,Y,'K',10). So will it use eucledainas the default method?

 채택된 답변

KSSV
KSSV 2022년 1월 9일

0 개 추천

The methods available are:
'euclidean' (default)
'seuclidean'
'cityblock'
'chebychev'
'minkowski'
'mahalanobis'
'cosine'
'correlation'
'spearman'
'hamming'
'jaccard'
Yes, the defualt method is euclidean.

댓글 수: 2

new_user
new_user 2022년 1월 9일
I mean just using this " [Idx, b] = knnsearch(X,Y,'K',10)" will the distance be automatically calculated using eucledian??? or I have to add "[Idx, b] = knnsearch(X,Y,'K',10, distance)" ??
KSSV
KSSV 2022년 1월 9일
You need not to mention. Thr meaning of default is, if you don't use/ mention the method name default method will be used.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2022년 1월 9일

댓글:

2022년 1월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by