| Mapping Toolbox | ![]() |
Find latitude and longitude coordinates for nonzero map entries
Syntax
[lat,lon] = findm(map,refvec) returns latitude and longitude vectors lat and lon, which provide the locations of all nonzero entries of the regular data grid map, with three-element referencing vector refvec.
[lat,lon,val] = findm(map,refvec) also returns the values val of the data grid corresponding to the lat and lon locations.
[lat,lon,val] = findm(latin,lonin,map) removes the regular matrix restriction. Two matrices, latin and lonin, the same size as map, must provide cell-by-cell latitude and longitude coordinates matched with the corresponding entries of map.
mat = findm(...) returns a single output mat of the form [lat,lon].
Description
This function works in two modes: with a regular matrix restriction and without.
Examples
The entered map can also be the result of a logical statement. Where is elevation greater than 5500 meters?
load topo mat = 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.
See Also
find |
Find indices and values of nonzero elements (see the online MATLAB Function Reference documentation) |
| filterm | fipsname | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |