# [Eeglablist] Maximum segment average amplitude, from single epochs

Bastien Boutonnet bastien.b1 at gmail.com
Mon Mar 24 20:42:55 PDT 2014

```Actually, because I implemented something like that once, but didn't use
squeeze what would the added value of squeeze be? I looked into the doc of
that function but I'm not sure I understand what it does.

Makoto, do you have a better way of explaining it than the matlab doc on
squeeze()?

-
Bastien Boutonnet, Ph. D.
Department of Psychology
bastienboutonnet.com

On 24 March 2014 20:12, Makoto Miyakoshi <mmiyakoshi at ucsd.edu> wrote:

> Dear Gaspar,
>
> Without checking it with Matlab...
> To make it simple, I'll use millisecond instead of datapoints.
>
> channelOfInterest = 10; % let's say you want to see Ch10.
> maxPoint = squeeze(max(EEG.data(channelOfInterest,300:800,:),[],2));
> minPoint = squeeze(max(EEG.data(channelOfInterest,maxPoint:1300,:),[],2));
> % Does this work? If not (and probably not), use for simple for loop, like
>
> minPoint = zeros(1,length(maxPoint));
> for n = 1:length(maxPoint)
> minPoint(n) =
> squeeze(max(EEG.data(channelOfInterest,maxPoint(n):1300,:),[],2));
> end
>
> meanMaxValue =
> squeeze(mean(EEG.data(channelOfInterest,maxPoint-50:maxPoint+50,:),2));
> meanMinValue =
> squeeze(mean(EEG.data(channelOfInterest,maxPoint-50:minPoint+50,:),2));
>
> Let me know if this does not work.
>
> Makoto
>
>
>
> 2014-03-24 10:21 GMT-07:00 Bastien Boutonnet <bastien.b1 at gmail.com>:
>
> Do you basically want to collect the maxima and then average over those
>> maximums?
>>
>> -
>> Bastien Boutonnet, Ph. D.
>> Department of Psychology
>> bastienboutonnet.com
>>
>>
>> On 24 March 2014 05:44, Gaspar Lukacs <lkcsgaspar at gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> I have problems with data extraction from single epochs, for which I'll
>>> probably need an algorithm. Specifically, within each epoch, from 300 to
>>> 800 ms I need to get the maximum positive 100 ms segment average amplitude,
>>> and then from the midpoint of this segment to 1300 ms, the maximum negative
>>> 100 ms segment average.
>>>
>>> The closest thing I could find is a "meanepoch.m" script which gets mean
>>> values between given latencies from single epochs - but it cannot search
>>> for maximum mean values (i.e. segment  averages)..
>>>
>>> I would be very grateful for any suggestions.
>>>
>>> Regards,
>>> Gaspar
>>>
>>> /Institute of Psychology, University of Szeged/
>>>
>>> _______________________________________________
>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>> To unsubscribe, send an empty email to
>>> eeglablist-unsubscribe at sccn.ucsd.edu
>>> For digest mode, send an email with the subject "set digest mime" to
>>> eeglablist-request at sccn.ucsd.edu
>>>
>>
>>
>> _______________________________________________
>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>> To unsubscribe, send an empty email to
>> eeglablist-unsubscribe at sccn.ucsd.edu
>> For digest mode, send an email with the subject "set digest mime" to
>> eeglablist-request at sccn.ucsd.edu
>>
>
>
>
> --
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20140324/968a573e/attachment.html>
```