0001 function [C_e, C_d] = elec_distance_consec(dist_e, dist_d)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 fprintf('\n%s\n\n', 'Calculating consecutive electrode distances.');
0017
0018
0019 End_e = strvcat('3', '5', '7', '9', '13', '22', '30', '41', '49', '54', '59', '67', '78', '86', '97', '101', '108', '110', '115', '117', '120', '124');
0020
0021 C_e = cell(0);
0022 C_d = [];
0023
0024
0025 for row = 1:length(dist_d)
0026
0027
0028
0029 NonZeroColumns = find(dist_d(row,:));
0030
0031 if ~isempty(NonZeroColumns)
0032
0033
0034
0035
0036 if( (row+1) <= length(dist_e) )
0037
0038 e = str2num(char(dist_e(row,row+1)));
0039
0040 if(strmatch(num2str(e(1)), End_e, 'exact'))
0041
0042
0043 else
0044
0045 C_d(end + 1) = dist_d(row,row+1);
0046 C_e(end + 1) = {num2str(e(1))};
0047 end
0048 end
0049 end
0050 end
0051 clear r x;