elec_distance_nn.m

来自「Matlab下的EEG处理程序库」· M 代码 · 共 37 行

M
37
字号
function [NN_e, NN_d] = elec_distance_nn(dist_e, dist_d)
% ELEC_DISTANCE_NN - Identify distance between nearest neighbour electrodes.
%
% Requires input data generated by 'elec_distance.m'
%
% Useage [NN_e, NN_d] = elec_distance_nn(dist_e, dist_d)
%
% where: dist_e & dist_d are derived from 'elec_distance'
%        utility and NN_e and NN_d are matrices that contain
%        nearest neighbour electrode labels and distances,
%        respectively.
%

% $Revision: 1.2 $ $Date: 2003/03/02 03:20:44 $

% Licence:  GNU GPL, no implied or express warranties
% History:  05/2000, Darren.Weber@flinders.edu.au
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  fprintf('\n%s\n\n', 'Calculating nearest neighbour electrode distances.');

  NN_e = cell(0);
  NN_d = [];

  for r = 1:length(dist_d(:,1))

       % Sort row r of dist_d in ascending order

       [NN_d(end + 1,:), index] = sort(dist_d(r,:));
		
       % Sort electrode labels in same order

       NN_e(end + 1,:) = dist_e(r,index);

  end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?