Use temporary variables (adults, kids, income) to avoid repeating subexpressions like elmestreet(:,3). Note that >> find(elmstreet(:,i)) will return indices of rows where column i is non-zero. These row indices can then be used in other expressions.