vb_trial_rejection
PURPOSE
function [MEGinfo,bexp,eeg] = vb_trial_rejection(MEGinfo,bexp,eeg,rejectTrial)
SYNOPSIS
function [MEGinfo,bexp,eeg] = vb_trial_rejection(MEGinfo,bexp,eeg,rejectTrial)
DESCRIPTION
CROSS-REFERENCE INFORMATION
This function calls:
- vb_setdiff2 Fast calculation of set difference 'setdiff' for interger index
This function is called by:
SOURCE CODE
0001 function [MEGinfo,bexp,eeg] = vb_trial_rejection(MEGinfo,bexp,eeg,rejectTrial)
0002
0003
0004
0005
0006
0007
0008
0009 TrialNumber = MEGinfo.TrialNumber;
0010 Ntrial = length(TrialNumber);
0011
0012
0013 Trial_act = vb_setdiff2(TrialNumber, rejectTrial);
0014
0015 MEGinfo.Nrepeat = length(Trial_act);
0016 MEGinfo.TrialNumber = Trial_act;
0017
0018 Nmax = max(TrialNumber);
0019
0020 if max(rejectTrial) > Nmax,
0021 error('Reject trial index is larger than trial number');
0022 end
0023
0024 if Ntrial ~= (MEGinfo.Nrepeat + length(rejectTrial))
0025 error('Reject trial index is not in trial index');
0026 end
0027
0028
0029 itrans = zeros(Nmax,1);
0030 itrans(TrialNumber) = 1:Ntrial;
0031
0032 id_act = itrans(Trial_act);
0033
0034
0035 bexp = bexp(:,:,id_act);
0036 eeg = eeg(:,:,id_act);
0037
0038 return
Generated on Mon 22-May-2023 06:53:56 by m2html © 2005