Authored by Anthony Boyer

Label detection is now more lenient

... ... @@ -61,14 +61,14 @@ for i0=1:size(Filename,1)
Cnamesfull={};
bipole=[];
for i1=1:numel(Name)
matched_1 = regexp(Name{i1},'^(?<letters>[a-zA-Z]+)(?<digits>[0-9]+)$','once','names');
label_name_1 = matched_1.letters;
label_number_1 = matched_1.digits;
matched_1 = regexp(Name{i1},'^(?<label>.*?)(?<index>[0-9]+)$','once','names');
label_name_1 = matched_1.label;
label_number_1 = matched_1.index;
matched_channels = 0;
for i2=1:numel(Name)
matched_2 = regexp(Name{i2},'^(?<letters>[a-zA-Z]+)(?<digits>[0-9]+)$','once','names');
label_name_2 = matched_2.letters;
label_number_2 = matched_2.digits;
matched_2 = regexp(Name{i2},'^(?<label>.*?)(?<index>[0-9]+)$','once','names');
label_name_2 = matched_2.label;
label_number_2 = matched_2.index;
if strcmp(label_name_1,label_name_2) & str2num(label_number_1)+1 == str2num(label_number_2) & ~(sum(isnan(Position(i1,:))) > 0) & ~(sum(isnan(Position(i2,:))) > 0)
matched_channels = matched_channels+1;
Cpos2full(:,end+1)= mean(Position([i1 i2],:))';
... ...