Recode the first fixation after target using loop

1 次查看(过去 30 天)
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by