?? knn.m
字號:
function [neighbors, distance] = knn(kde,points,k)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% [neighbors, distance] = knn(kde,points,k)
%
% Find the k nearest neighbors to the point set 'points' (an Ndim x Npts
% double array) within the kde. The neighbors are returned as a set
% of indices (neighbors); the optional second return value is the
% distance to the k^th nearest neighbor. Note that the
% nearest neighbor of a point can include the point itself,
% i.e. a point of distance 0.
%
% See also: kde, getPoints
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2003 Alexander Ihler; distributable under GPL -- see README.txt
%#mex
error('MEX-file kde/knn not found -- please recompile if necessary');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -