Will give a logical vector with true(1) the males and false(0) the females. With this logical vector you can index the columns which refer to the response times of the males.
ResponseTimes(:,ismember(Gender, 'Male'))
This will build the matrix with the response times of all males
Now you only have to take the mean in each column of the previous matrix
MeanResponseTimeofMales = mean(ResponseTimes(:,ismember(Gender, 'Male')))
- For the second question:You have to build a logical matrix that will indicate which response times are above 2.5. Similarly you do this by:
The true values (1) will be the ones above 2.5 and the false values (0) will be the ones less or equal to 2.5.
Now simply you need to find if ANY of the columns have at least one true value. You do this by logical indexing:
Now, since you know which columns have at least one true value you must use the previous logical vector to index your Name cell.
Names(any(ResponseTimes>2.5))
but read about logical indexing, ismember and any. And as Walter said, spend some time reading the how-to-ask-questions tutorial