How to identify the location of a cell that meets a specific quantity condition?

Illustration
Nalani - 2020-10-03T11:52:56+00:00
Question: How to identify the location of a cell that meets a specific quantity condition?

Is anyone familiar with an in-built MATLAB command that can specify locations of where a certain conditions is met? For Example: I have a gradient intensity matrix that lists the intensity of each pixel in an image and I want to find the index locations [x,y] of all pixels with a value greater than a set threshold. I know this can be done in a FOR loop but I was curious if there was an equivalent like how some other coding languages have.

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

[x, y] = find (matrix > value)


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!