MATLAB: Compare elements in a column and exit while loop

compare element

hi,
i have two matrices, each of size 2xn and 2xm. i would like to select one column from each of these matrices and compare its elements. now even if any one of the elements meet the condition then i would like to exit a while loop. for example-
A=[a11 a12; a21 a22]
B=[b11 b12 b13; b21 b22 b23]
now i want to find the difference the first columns of each of the matrices. meaning (a11 vs b11) and (a21 vs b21). now if any one of these two results is below a certain value then i would like to exit the while loop.

Best Answer

Perhaps with some guessing:
A = rand(2, 2);
B = rand(2, 3);
% For the 2nd while loop:
while ???
if any(A(:, 1) - B(:, 1) < Limit)
break;
end
end
I do not have an idea for the 1st part, because it is not clear which column you want to choose and how you want to "compare" the values.