: [i, j] = worldToSubscript (r, xWorld, yWorld)

Convert world coordinates to row and column subscripts.

Converts world coordinates to row and column subscripts of an image associated with the spatial referencing object r. A point located at (xWorld(i), yWorld(i)) world coordinates maps to row and column subscripts i(i) and j(i) respectively. Note the reversed order of the dimensions. If the point falls outside the bounds of the image, both its row and column subscripts are NaN.

See also: imref2d, imref3d, worldToIntrinsic.

Package: image