| Mapping Toolbox | ![]() |
Find latitude and longitude coordinates for nonzero map entries
Syntax
[lat,lon] = findm(map,maplegend) [lat,lon,val] = findm(map,maplegend) [lat,lon,val] = findm(latin,lonin,map) mat = findm(...)
Description
This function works in two modes: with a regular matrix restriction and without.
[lat,lon] = findm(map,maplegend) returns latitude and longitude vectors lat and lon, which provide the locations of all nonzero entries of the regular matrix map, map, with three-element map legend vector maplegend.
[lat,lon,val] = findm(map,maplegend) also returns the values, val, of the matrix map 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].
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 online MATLAB Function Reference) |
| filterm | flat2ecc | ![]() |