Hello,
I have a 2D matrix of random numbers and NaNs, of 15x129. I want to find where in the matrix the values are closest to the number 15 along each column, and output a logical 15x129 matrix (where number is closest to 15 = 1, where number is less than 15 = 0 or nan) . So out of the 15 values, which value is closest to the number 15.
Thank you,
Holly
1 Comment
Sargondjani (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/443321-how-to-find-the-closest-value-to-a-constant-in-a-2d-matrix#comment_667961
Sign in to comment.