filterm
Filter latitudes and longitudes based on underlying data grid
Description
Examples
Display points along the equator that are above sea level.
First, load elevation raster data and a geographic cells reference object. The raster contains terrain heights relative to mean sea level. Then, specify the coordinates of evenly spaced points along the equator.
load topo60c
lon = (0:5:360)';
lat = zeros(size(lon));
Create a logical array representing the terrain above sea level. Then, filter the points along the equator to include only the elements that contain true
.
topoASL = topo60c > 0; [newlat,newlon] = filterm(lat,lon,topoASL,topo60cR,1);
Create a world map and display the elevation data. Display the all of the points along the equator using red markers. Then, display the points that are above sea level using yellow circles.
worldmap world geoshow(topo60c,topo60cR,'DisplayType','texturemap') demcmap(topo60c) geoshow(lat,lon,'DisplayType','point','MarkerEdgeColor','r') geoshow(newlat,newlon,'DisplayType','point','Marker','o',... 'MarkerFaceColor','y')
Input Arguments
Latitude values, specified as a numeric array.
Data Types: single
| double
Longitude values, specified as a numeric array.
Data Types: single
| double
Filter, specified as a numeric array.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
Spatial referencing information, specified as a GeographicCellsReference
object or a GeographicPostingsReference
object. The RasterSize
property of R
must be consistent with
size(Z)
.
Data Types: double
Allowed values, specified as a numeric array or character vector.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| char
Output Arguments
Latitudes of filtered points, returned as a numeric array.
Longitudes of filtered points, returned as a numeric array.
Indices of filtered points, returned as a numeric array.
Version History
Introduced before R2006aThe filterm
function does not accept referencing vectors or
referencing matrices as input. Use a geographic raster reference object, specified as a
GeographicCellsReference
or GeographicPostingsReference
object, as input instead. Reference objects have
several advantages over referencing vectors and referencing matrices.
Unlike referencing vectors and referencing matrices, reference objects have properties that document the size of the associated raster, its geographic limits, and the direction of its rows and columns.
You can manipulate the limits of geographic rasters associated with reference objects using the
geocrop
function.You can manipulate the size and resolution of geographic rasters associated with reference objects using the
georesize
function.
To update your code, create a geographic reference object.
Create a geographic reference object for a raster of cells by using the
georefcells
function.Create a geographic reference object for a raster of regularly posted samples by using the
georefpostings
function.Convert from a referencing vector to a geographic reference object by using the
refvecToGeoRasterReference
function.Convert from a referencing matrix to a geographic reference object by using the
refmatToGeoRasterReference
function.
Once you have created a reference object, replace uses of the referencing vector or referencing matrix in your code with the reference object.
When you specify a referencing vector or referencing matrix as input, the
filterm
function issues a warning that it will not accept referencing
vectors or referencing matrices as input in a future release.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)