[Eeglablist] script example, to extract epochs?

Andrew Hill andrewhill at ucla.edu
Sat Jun 27 20:59:20 PDT 2009


Thanks Hamish, Joe, and others who have replied.

I guess memory always will "be an issue".. I'm just surprised that  
Matlab seems unable to load a 250mb .set file twice without crashing  
(on a 2.8ghz Mac with 4gb RAM).
I'll upgrade to 64-bit matlab.  In the meantime, I've simplified my  
script to use pop_epoch within a loop, and save out new files for each  
series of event types:

% Epoch using c, Cond, trigs for named conditions of 4 event codes each
     for c = [1:4];
     Cond = [ 'LVF_ConTarg_AllCue'; 'LVF_IncTarg_AllCue';  
'RVF_ConTarg_AllCue'; 'RVF_IncTarg_AllCue' ];
     trigs = [{'110', '111', '112', '113'}; {'120', '121', '122',  
'123'}; {'210', '211', '212', '213'}; {'220', '221', '222', '223'} ];
     OUTEEG = pop_epoch(EEG, 'typerange',trigs(c,:) );
     [ALLEEG, OUTEEG] = pop_newset(ALLEEG, OUTEEG, 'setname',  
Cond(c,:), 'savenew', [int2str(S),'_AVGREREF_',Cond(c,:)],  
'overwrite', 'on', 'gui', 'off');
     end

Only problem is this is throwing the following error:

??? Error using ==> pop_epoch at 371
pop_epoch(): multiple event types must be entered as {'a', 'cell',  
'array'}

Error in ==> quadtest3brief at 17
     OUTEEG = pop_epoch(EEG, 'typerange',trigs(c,:) );

Even though trigs(c,:) does have a cell array in it...

 >> trigs(c,:)
ans =  '110'    '111'    '112'    '113'


I've also tried something like this, and it produces the same error:
trigs = [110, 111, 112, 113; 120, 121, 122, 123; 210, 211, 212, 213;  
220, 221, 222, 223 ];
trigscellarray = num2cell(trigs)

and has this sort of array

trigscellarray =

     [110]    [111]    [112]    [113]
     [120]    [121]    [122]    [123]
     [210]    [211]    [212]    [213]
     [220]    [221]    [222]    [223]

But still fails with the same error.  :/
Anyone have any ideas?

Thanks,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20090627/3de8be62/attachment.html>


More information about the eeglablist mailing list