Write a for loop to find the mean and standard error of reaction time in each condition and put them in a structure?
1 次查看(过去 30 天)
显示 更早的评论
I have a dada containing a single subject performing a stroop task.
Cong - 1=congruent, 2=neutral, 3=incongruent
Stim - 1=words, 2=colours
data - reaction time
err - error rate, 1=error
how to write a for loop to find the mean and standard error of reaction time in each condition and put them in a structure?
Here is my code:
for k=1:3
meancong(k) = mean(data(cong==k))
stdcong(k)=std(data(cong==k))
end
But I don't know how to save each condition separately and put them in a struture. Can anybody help?
0 个评论
回答(1 个)
Divya Yerraguntla
2020-3-17
Have a look at a similar question : https://in.mathworks.com/matlabcentral/answers/166201-how-to-iterate-through-structure-fields?s_tid=answers_rc1-1_p1_Topic
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!