0001 function [pinfo] = mne_patch_info(nearest)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 me='MNE:mne_patch_info';
0016
0017 if nargin ~= 1
0018 error(me,'Incorrect number of arguments');
0019 end
0020
0021 if isempty(nearest)
0022 pinfo = [];
0023 return;
0024 end
0025
0026 [ sorted, indn ] = sort(nearest);
0027
0028 [uniq,firsti,dum] = unique(sorted,'first');
0029 [uniq,lasti,dum] = unique(sorted,'last');
0030
0031 for k = 1:length(uniq)
0032 pinfo{k} = indn(firsti(k):lasti(k));
0033 end
0034
0035 return;
0036