PPT Slide
Selecting Elements with 0/1 Arrays
If a vector of 0’s and 1’s is used as a subscript of an array of the same length, the result is a new array containing only those elements of the old array with a 1 subscript.
This is especially useful when the result of a logical expression is used as a subscript to select array elements based on some condition.