MATLAB: Matlab help with coding

What would be the code to compute the maximum value of column 1 that is less than 200?
The numbers are
1 5 600
2 5 155
8 5 234
3 5 100

Best Answer

A = [1 5 600
2 5 155
8 5 234
3 5 100];
maxval = max(A(A(:,1)<200,1))
If you want to change which column you search for, then change the 1's to the corresponding column number (e.g. maxval_col3 = max(A(A(:,3)<200,3))