Recode the first fixation after target using loop

2 visualizzazioni (ultimi 30 giorni)
Xin Huang
Xin Huang il 16 Dic 2020
Modificato: Xin Huang il 16 Dic 2020
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.

Risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by