Mapping Toolbox | ![]() ![]() |
Determine matrix map entries or interpolated values associated with latitude-longitude points
Syntax
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 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 cells, respectively.
Examples
Find the elevations in topo
associated with three European cities - Milan, Bern, and Prague (topo
elevations are in meters):
The 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 = 313 1660 297
See Also
findm |
Coordinates of nonzero map entries |
![]() | los2 | majaxis | ![]() |