speed optimization in "for" loops
古いコメントを表示
Hi,
I have an experiment with 864 trials. I have an array named Edf_Trials3, with data of saccadic eye movements during the entire experiment. In some trials I have more than one eye movement, in others there is none.
I have an other array, named Time_EndPpt6, with the time of the stimuli presentation in each trial.
I would like to add the time of the stimuli presentation in the former array "Edf_Trials3", on the same line of the corresponding trial.
For that i'm using 2 loops but it's very very long.
Could you help to simplify my code in order to boost the process ?
I add the two arrays. this is my code:
for (j=1:height(Edf_Trials3))
for(i=1:length(Time_EndPpt6))
if (Edf_Trials3.Trial(j)==i)
Edf_Trials3.EndTime_of_Ppt(j)=Time_EndPpt6(i);
end
end
end
Thanks for your help
1 件のコメント
Jan
2018 年 10 月 24 日
I'd omit the strange parentheses for the for and if commands. It works, but does not look Matlabish.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!