MATLAB: How can i get RGB value if i have position(x,y)

-

if i have position of image(pixel) . How can i get RGB value of this position?

Best Answer

Note that row = y and is the first index, not the second index.
redValue = rgbImage(y, x, 1);
greenValue = rgbImage(y, x, 2);
blueValue = rgbImage(y, x, 3);