[Eeglablist] Error in pop_artextval.... dataline = EEG.data(chanArray(ch), p1:p2 ,i);

sujata sinha sujatasinhacse at gmail.com
Sat Dec 28 19:29:18 PST 2019


Dear All,


I am trying to code the artifact rejection steps but I am facing an error.
Interestingly, the code works on another computer but not on my current
working computer.

The error that pops up on running the code is:
"Index in position 3 exceeds array bounds (must not exceed 1).
Error in pop_artextval (line 236)
                dataline = EEG.data(chanArray(ch), p1:p2 ,i);"
I would like to know what could be the reason for such an error? How do I
solve it?


Following are a few of the lines of code that I used for artifact detection
followed by ERP calculation:
%----------------------------------------------------------------------------
 electrodes=[4 5 6 8:27];
 frontals = [1:3 7];

 placingelectrode = {'nch1 = ch1 label Fp2',  'nch2 = ch2 label Fp1',
 'nch3 = ch3 label F7',  'nch4 = ch4 label F3',...
        'nch5 = ch5 label Fz',  'nch6 = ch6 label F4',  'nch7 = ch7 label
F8',  'nch8 = ch8 label FC5',  'nch9 = ch9 label FC1',  'nch10 = ch10 label
FC2',...
        'nch11 = ch11 label FC6',  'nch12 = ch12 label T7',  'nch13 = ch13
label C3',  'nch14 = ch14 label Cz',  'nch15 = ch15 label C4',...
        'nch16 = ch16 label T8',  'nch17 = ch17 label CP5',  'nch18 = ch18
label CP1',  'nch19 = ch19 label CP2',  'nch20 = ch20 label CP6',  'nch21 =
ch21 label P7',...
        'nch22 = ch22 label P3',  'nch23 = ch23 label Pz',  'nch24 = ch24
label P4',  'nch25 = ch25 label P8',  'nch26 = ch26 label O1',...
        'nch27 = ch27 label O2'};

    % artifact detection
    %peak to peak for non-frontals
    EEG  = pop_artextval( EEGSET , 'Channel', electrodes, 'Flag',  1,
'Threshold', [ -75 75], 'Twindow', [ -204 1000] );

    %peak to peak for fp1 fp2 f7 f8
    EEG  = pop_artextval( EEG , 'Channel', frontals, 'Flag',  1,
'Threshold', [ -100 100], 'Twindow',...
        [ -204 1000] );

    %flat line
    EEG  = pop_artflatline( EEG , 'Channel', electrodes, 'Duration',  100,
'Flag',  1, 'Threshold', [ -1e-07 1e-07], 'Twindow',...
        [ -204 1000] );

    EEG  = pop_artflatline( EEG , 'Channel', frontals, 'Duration',  100,
'Flag',  1, 'Threshold', [ -1e-07 1e-07], 'Twindow',...
        [ -204 1000] );


    % compute erp
    ERP = pop_averager( EEG , 'Criterion', 'good', 'DSindex',1,
'ExcludeBoundary', 'on', 'SEM', 'on' );

    % placing the electrodes for plot
    ERP = pop_erpchanoperator( ERP, placingelectrode , 'ErrorMsg', 'popup');

%----------------------------------------------------------------------------------------------------------------------
Thanks and regards
Sujata Sinha



More information about the eeglablist mailing list