| Mapping Toolbox | Search  Help Desk |
| ltln2val | Examples See Also |
Determine matrix map entries or interpolated values associated with latitude-longitude points
Syntax
value = ltln2val(map,maplegend,lat,lon) value = ltln2val(map,maplegend,lat,lon,method)
Description
value = ltln2val(map,maplegend,lat,lon) returns the values of the regular matrix map,map, corresponding to the locations specified by the vectors lat and lon.
value = ltln2val(map,maplegend,lat,lon,method) specifies the method for determining the returned value. The entry values of a matrix map are actually vertex values. The default method is 'nearest', which returns the unaltered value of the cell containing the coordinates lat and lon. Using a method of 'linear' or 'cubic' results in values that are linearly and cubically interpolated between vertices, respectively.
Examples
Find the elevations intopo associated with three European cities - Milan, Bern, and Prague (topo elevations are in meters):
load topoThe city locations, [Milan Bern Prague]:
lats = [45.45; 46.95; 50.1];
longs = [9.2; 7.4; 14.45];
elevations = ltln2val(topo,topolegend,lats,longs)
elevations =
94
902
545
See Also
findm |
Coordinates of nonzero map entries |