Hi Muhammad,
you may try something like this
D=spm_eeg_load('your_aef_etc.mat') %load epoched data
iD=clone(D, ['i' fnamedat(D)], size(D)); %create empty data set of the
same size
for k=1:length(D.condlist) %loop over conditions
ind=pickconditions(D,D.condlist{k});
erp=mean(D(:,:,ind),3); % compute erp
for i=1:length(ind)
iD(:,:,ind(i))=D(:,:,ind(i))-erp; %subtract erp from each
single trial
end
end
save(iD);
hope this helps ;)
Bernhard
Am 9/2/2010 8:48 PM, schrieb MP:
> Hello Vladimir and other M/EEG SPMers,
>
> I am working with a dataset that has 4 conditions. I have preprocessed
> the data using SPM8 and now have averaged ERP for each condition. Now,
> I would like to subtract this averaged ERP for each condition from
> individual trials of the same condition. How can i do that? How can I
> add this step to my script?
>
> Thanks
>
> - Muhammad
--
-----------------------------------------------
Dr. Bernhard Spitzer
Bernstein Center for Computational Neuroscience
Charité Universitätsmedizin Berlin
Philippstr. 13 House 6
10115 Berlin
Germany
Phone: +49 (0)30 2093-6789
Fax: +49 (0)30 2093-6771
|