Recode the first fixation after target using loop
2 次查看(过去 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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!