isprop
Determine if property exists in geographic or planar vector
Description
Examples
Check If a Single Property Exists in Geoshape Vector
Create a geoshape vector.
s = geoshape(-33.961, 18.484, 'Name', 'Cape Town');
Check if Latitude
and Name
are properties in the geoshape vector.
isprop(s, 'Latitude')
ans = logical
1
isprop(s, 'Name')
ans = logical
1
Both Latitude
and Name
are properties in the geoshape vector.
Check If Multiple Properties Exist in a Mappoint Vector
Create a mappoint vector.
mp = mappoint(-33.961, 18.484, 'Name', 'Cape Town')
mp = 1x1 mappoint vector with properties: Collection properties: Geometry: 'point' Metadata: [1x1 struct] Feature properties: X: -33.9610 Y: 18.4840 Name: 'Cape Town'
Check if a group of properties exist in the mappoint vector.
tf = isprop(mp, {'X','x','Latitude','Name'})
tf = 1x4 logical array
1 0 0 1
The first and last elements of tf
are 1 (true) because the properties X
and Name
exist in the mappoint vector. The second and third elements of tf
are 0 (false) because the properties x
and Latitude
do not exist in the mappoint vector. Property names are case-sensitive.
Input Arguments
name
— Name of single property
character vector
Name of a single property, specified as a character vector.
names
— Name of multiple properties
cell array of character vectors
Name of multiple properties, specified as a cell array of character vectors.
Output Arguments
tf
— Flag indicating the property exists in the geographic or planar vector
logical scalar or vector
Version History
Introduced in R2012a
See Also
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)