all(mymatrix(IndexToCompare, :) > myBenchmark,1)
The result would be a vector of the same length as IndexToCompare, and which will be true for the columns corresponding to IndexToCompare in which each row entry is strictly greater than the corresponding entry in myBenchmark .
Note that the random generation you are doing can include the first column, and the first column can never be strictly greater than itself.
1 Comment
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/590818-logical-indexing-on-a-matrix#comment_1001785
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/590818-logical-indexing-on-a-matrix#comment_1001785
Sign in to comment.