|
466 | 466 | % data |
467 | 467 | alleeg = cellfun(@(t) pop_loadset(eminfname{contains(eminfname, t)}), em{1}); |
468 | 468 | if numel(alleeg) ~= numel(em{1}) |
469 | | - fid = fopen(fullfile(aas_getsesspath(aap,subj,sess),'emptymatch'),'w'); |
470 | | - fprintf(fid,strjoin(em{1},' + ')); |
| 469 | + fid = fopen(fullfile(aas_getsesspath(aap,subj,sess),'emptymatch'),'a'); |
| 470 | + fprintf(fid,'%s\n',strjoin(em{1},' + ')); |
471 | 471 | fclose(fid); |
472 | 472 | continue; |
473 | 473 | end |
|
494 | 494 | end |
495 | 495 | end |
496 | 496 | end |
497 | | - if isempty(selEv) ||... |
498 | | - any([alleeg.trials] == 1) % treated as continuous data by EEGLAB, which removes epochs |
499 | | - fid = fopen(fullfile(aas_getsesspath(aap,subj,sess),'emptymatch'),'w'); |
500 | | - fprintf(fid,strjoin(em{1},' + ')); |
| 497 | + isemptymatch = isempty(selEv) ||... |
| 498 | + any([alleeg.trials] == 1); % treated as continuous data by EEGLAB, which removes epochs |
| 499 | + if isemptymatch |
| 500 | + fid = fopen(fullfile(aas_getsesspath(aap,subj,sess),'emptymatch'),'a'); |
| 501 | + fprintf(fid,'%s\n',strjoin(em{1},' + ')); |
501 | 502 | fclose(fid); |
502 | | - continue; |
| 503 | + break; |
503 | 504 | end |
504 | 505 |
|
505 | 506 | % - select event matched with all other EEGs |
|
541 | 542 | alleeg(indeeg).epoch(indEp) = rmfield(currEp,setdiff(fieldnames(currEp),fieldnames(alleeg(indeeg).epoch))); |
542 | 543 | end |
543 | 544 | end |
| 545 | + if isemptymatch, continue; end |
544 | 546 |
|
545 | 547 | % save EEGs; |
546 | 548 | for eeg = alleeg |
|
0 commit comments