You can use logical indexing in MATLAB to achieve this. Given a matrix M
containing the response time of each trial for each subject, you can create a logical index of trials that have a response time greater than 2.5:
main.m80 chars3 lines
Then, you can apply the any
function along the rows of this logical index to determine if there is at least one trial with a response time greater than 2.5 for each subject:
main.m36 chars2 lines
Finally, you can use this logical index to filter the list of subject names:
main.m95 chars3 lines
If you want to use a for-loop instead of any
, you can do:
main.m140 chars7 lines
gistlibby LogSnag