setpostn - Convert latitude-longitude to data grid rows and columns

Syntax

[row,col] = setpostn(Z,refvec,lat,long)
indx = setpostn(Z,refvec,lat,long)
[row,col,indxPointOutsideGrid] = setpostn(Z,refvec,lat,long)

Description

[row,col] = setpostn(Z,refvec,lat,long) returns the row and column indices of the input regular data grid Z with a three-element referencing vector refvec for the points specified by the vectors lat and long. All angles are in degrees.

indx = setpostn(Z,refvec,lat,long) returns the single-value indices of map(:).

[row,col,indxPointOutsideGrid] = setpostn(Z,refvec,lat,long) also returns the indices of lat and long corresponding to points outside Z. These points are always ignored in row and col.

Examples

What are the matrix coordinates in topo of Denver, Colorado, at (39.7ºN,105ºW)?

load topo
[row,col] = setpostn(topo,topolegend,39.7,105)

row =
   130
col =
   105

See Also

latlon2pix, ltln2val, setltln

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS