I am currently trying to do artifact rejection on my EEG.data. I have three sets of epoched data (in 3D matrices, for example 64(channels)x250(samplingtimes)x98(trials)).
I need to create a loop that runs through my EEG.data files and removes the trials containing values over/under 100 uV. For example, eye blink artifacts are easily detected in the Fp1 and Fp2 channels, which correspond to row 1 and 2 of the first dimension of my matrix. So if EEG.data(1:2, : , trial) >= 100, delete the trial. I am very new to matlab and would really appreciate any help.
for a=size(epochs_CG,3) % for the size of my
if epochs_CG(1:2, :, a)> 100 epochs_CG(:,:,a) = []; elseif epochs_CG (1:2, :, a)< 100 epochs_CG(:,:,a) = []; endend
This did not work 😛
Best Answer