Clear Filters
Clear Filters

Recode the first fixation after target using loop

1 view (last 30 days)
I am a freshman to Matlab and recently need to use it to do some data analysis. I have an eeg.event strcuture with one of fileds called 'type', I need to recode the first fixation (L_fixation) after stimulus onset ('111'). See the screenshot below.
Here is my code:
ix_nonrep=find(ismember({EEG.event.type},'111'));
for i=1: length(ix_nonrep)
while ~ismember({EEG.event.type}, 'L_fixation')
ix_nonrep(i)= ix_nonrep(i)+1;
[ffix]=ix_nonrep(i,:)
end
end
But I can't make it work as I what I hoped. I want to the loop can return the index, so I can use the index to rename the events. Does anyone know how to make it work? Thank you in advance.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!