MATLAB is "MATrix LABoratory" -- it operates on matrices and arrays by builtin syntax; that's a primary source of its power and usefulness. "We don't need no steenkin' loops!" :)
YIELDTHRESHOLD=0.02; % don't bury magic numbers in code; use variables so can change
DivYieldAboveThresh=DividendYield2019(DividendYield2019>YIELDTHRESHOLD); % use logical addressing
The above is one of the most powerful addressing features in MATLAB -- look up "logical addressing" in the documentation.