4 %
function which computes the set P_M(mu,C) with M\in\mathbb{N}, mu the
5 % parameter and C a set of parameters (the parameters in C have the same
6 % size as mu. The set P_M(mu,C) is defined as
7 % P_M(mu,C) = {the M closest neigbours of mu in C, measured in |.|,
if 1 <= M < C,
11 % The second output ind contains the indices of the M closest neighbours of
14 % Dominik Garmatter 23.03 2012
19 if M ~= 0 && isequal(C,[]) ~= 1
20 mu = mu(:); % we assume that every row of C contains a parameter
25 [~,I] = sort(sqrt(sum((A-C).^2)));
27 [~,I] = sort(abs(A-C));
function [ P_M , ind ] = scm_get_neighbours(M, mu, C)
[P_M, ind] = scm_get_neighbours(M, mu, C)