I wouldn't call it l - It's probably the single worst name, other than O that you could use. I looks too much like 1(one) and l (lower case L). Call it props since it comes from regionprops(). So
allCentroids = [props.Centroid];
xCentroids = allCentroids(1:2:end);
yCentroids = allCentroids(2:2:end);