However I would in general expect that to fail as y would probably not be the same length.
The above code assumes that the two vectors are on the same origin and spacing, so the extra elements for x2_lower represent elements beyond the end of x1_lower and each element x1_lower(K) corresponds to x2_lower(K). If that is not the case then you need information about the origin and increments in order to align the two.