Mapping Toolbox | ![]() ![]() |
Get latitudes and longitudes from matrix row and column coordinates
Syntax
[lat,lon] = setltln(map,maplegend,row,col) mat = setltln(map,maplegend,row,col) [lat,lon,badindx] = setltln(map,maplegend,row,col)
Description
[lat,lon] = setltln(map,maplegend,row,col) returns the latitude and longitudes associated with the input row and column coordinates of the input map
with a map legend vector of maplegend
.
mat = setltln(map,maplegend,row,col) returns the coordinates in a single, two-column matrix of the form [latitude longitude]
.
[lat,lon,badindx] = setltln(map,maplegend,row,col) returns the indices of the elements of the row
and col
vectors that lie outside the input map. The outputs lat
and lon
always ignore these points; the third output accounts for them.
Examples
Find the coordinates of row 45, column 65 of topo
:
load topo [lat,lon,badindx] = setltln(topo,topolegend,45,65) lat = -45.5000 lon = 64.5000 badindx = [] % Empty since the point is valid
See Also
ltln2val |
Latitude and longitude to matrix entry value |
setpostn |
Latitude and longitude to row and column |
![]() | sec2hr | setm | ![]() |