I have the 1x1008 struct array EEG.event with fields

```
latency
duration
channel
bvtime
bvmknum
type
code
urevent

```

I want to delete all rows where entry in field EEG.event.type = 'boundary' or 'R 1'

I tried the following loop:

```
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

```

This does not work of course, since the counting variable `b` at some point exceeds the length of `EEG.event`.

Does anyone have an idea how to delete particular rows?