I have a NxM matrix where some rows has the code 999 for missing values. All matrix elements are temperature over land, so sensible numbers are between -100 and 100. Each row represents one 'grid' over time, so if the first element in, say row 10 is 999, then the rest are also.
I want to delete all rows with numbers larger than for example 100. A toy example that gives me the right answer is:
A = [1 1; 3 3; 999 999; 4 4; 999 999]
A(A(:,:)>100)=[]
reshape(A,3,2)
I do not like that the matrix A is transformed in line 2 so that I have to do the reshape.
Is there a better way to delete, in this case, rows 3 and 5?