A logical array index designates the elements of an array A based on their position in the indexing array, B, not ...
www.mathworks.com