Main Content

isempty

Determine if geographic or planar vector is empty

Description

tf = isempty(v) determines whether the geographic or planar vector v is empty.

example

Examples

collapse all

Create a default geopoint vector.

gp = geopoint()
gp = 

 0x1 geopoint vector with properties:

 Collection properties:
     Geometry: 'point'
     Metadata: [1x1 struct]
 Feature properties:
     Latitude: []
    Longitude: []

Check if the geopoint vector is empty. A returned value of 1 (true) indicates the vector is empty.

isempty(gp)
ans = logical
   1

Create a second geopoint vector, specifying a geographic point. Confirm that this vector is not empty. A returned value of 0 (false) indicates the vector is not empty.

gp2 = geopoint(42.356,-71.101)
gp2 = 
 1x1 geopoint vector with properties:

 Collection properties:
     Geometry: 'point'
     Metadata: [1x1 struct]
 Feature properties:
     Latitude: 42.3560
    Longitude: -71.1010

isempty(gp2)
ans = logical
   0

Input Arguments

collapse all

Geographic or planar vector, specified as a geopoint, geoshape, mappoint, or mapshape object.

Output Arguments

collapse all

Flag indicating geographic or planar vector is empty, returned as a logical scalar. tf is True when v is empty.

Data Types: logical

Version History

Introduced in R2012a