| Mapping Toolbox | ![]() |
www.kxcad.net Home > CAE Software Index > MATLAB Index >
Latitudes and longitudes of nonzero data grid elements
[lat,lon] = findm(Z,refvec)
[lat,lon,val] = findm(Z,refvec)
[lat,lon,val] = findm(Lats,Lons,Z)
mat = findm(...)
[lat,lon] = findm(Z,refvec) returns latitude and longitude vectors lat and lon, which provide the locations of all nonzero entries of the regular data grid Z, with three-element referencing vector refvec.
[lat,lon,val] = findm(Z,refvec) also returns the values val of the data grid corresponding to the lat and lon locations.
[lat,lon,val] = findm(Lats,Lons,Z) removes the regular matrix restriction. Two matrices, Lats and Lons, the same size as Z, must provide cell-by-cell latitude and longitude coordinates matched with the corresponding entries of Z.
mat = findm(...) returns a single matrix mat of the form [lat,lon].
This function works in two modes: with a regular data grid and with a geolocated data grid.
The entered map can also be the result of a logical statement. Where is elevation greater than 5500 meters?
load topo [lat lon] = findm((topo>5500),topolegend) mat = 34.5000 79.5000 34.5000 80.5000 30.5000 84.5000 28.5000 86.5000
These points are in the Himalayas. Find the grid values at these locations with setpostn:
heights = topo(setpostn(topo, topolegend, lat, lon))
heights =
5559
5515
5523
5731You must use a regular data grid in order to retrieve the elevations from setpostn.
find (MATLAB function), setpostn
| filterm | fipsname | ![]() |
© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments