% L = knn(X,Y,x,K) k-nearest neighbour classifier
%
% In:
%   X: NxD matrix containing N D-dimensional data points rowwise (training).
%   Y: Nx1 matrix containing the class labels for X (in 1..K).
%   x: MxD matrix containing M D-dimensional data points rowwise (test).
%   K: (scalar) number of nearest neighbours to use.
% Out:
%   L: Mx1 matrix containing the predicted class labels for x.

function L = knn(X,Y,x,K)

