[Eeglablist] remove entire rows from EEG.event

Katie Lavigne lavigne.k at gmail.com
Sat Mar 26 10:13:01 PDT 2016


Hi Clemens,

There might be a better way to do this, but I usually just count as I'm
deleting and subtract that from what I want to delete. Something like this:

del = 0;

for j = 1:size(EEG.event,2)

    if strcmp(EEG.event(j-del).type, 'DIN7')

        EEG.event(j-del) = [];

        del = del + 1;

    elseif strcmp(EEG.event(j-del).type, 'boundary')

        EEG.event(j-del) = [];

        del = del + 1;

    end

end

Hope that helps,

Katie

On Sat, Mar 26, 2016 at 5:36 AM, Clemens DICKHUT <clemens.dickhut at uni.lu>
wrote:

> Hi all,
>
> I’d like to remove rows in EEG.event that I don’t need.
>
> Is there a straight forward way to delete rows in a struct array with
> fields, depending on a particular field entry?
> I tried the following:
>
> for b = 1:length(EEG.event)
>
>
>          if strcmp(EEG.event(b).type, 'boundary')
>             EEG.event(b) = [];
>          elseif strcmp(EEG.event(b).type, 'R  1')
>             EEG.event(b) = [];
>          end
>
>
> end
>
>
>
> Putting a for loop around it doesn’t help much as b exceeds the new
> EEG.event length at some point...
>
> Hope someone can help. Thanks a lot in advance.
>
> Best,
> Clemens
>
>
>
> __________________________________
> Clemens Dickhut, M.Sc., (PhD Student)
> Institute for Health and Behaviour
> Research Unit INSIDE
> University of Luxembourg - Campus Belval
> Maison des Sciences Humaines
> 11, Porte des Sciences, R. 04 415
> L-4366 Esch-sur-Alzette
> Tel.: (+352) 46 66 44 9536
>
>
>
>
> _______________________________________________
> 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
>



-- 
Katie Lavigne , PhD Candidate
Cognitive Neuropsychiatry of Schizophrenia Lab
BC Mental Health and Addictions Research Institute (BCMHARI)
3rd floor, 938 West 28th ave.
Vancouver, BC
V5Z 4H4

Phone: (604) 875-2000 x 4734
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20160326/38dd5216/attachment.html>


More information about the eeglablist mailing list