MATLAB: How to find the earliest time for which the absolute value in a vector is less than 10

for loopif statementmatrix

I got a nxn matrix, and i'm going to compare all the absolute values in each colomn if they are all less than 10. The comparison start from first colomn and continue on the next one until first to find all the absolute values in a colomn are less than 10.
I have the Matrix A = [-9 -8 -8 -8 ; -9 -9 -9 -9; -10 -10 -10 -9; -10 -10 -10 -9]

Best Answer

col_number = find( all(A<10), 1, 'first' );
The response can be [] if none satisfy the condtion.
It is a bit confusing that you are asking about < 10 when all of the entries are negative.