rmfield

Remove dynamic property from geographic or planar vector

Description

example

vout = rmfield(vin,name) removes the dynamic property specified by name from the geographic or planar vector vin.

example

vout = rmfield(vin,names) removes all dynamic properties specified by names from vin.

Note

rmfield cannot remove Metadata, and Geometry properties from any geographic or planar vector. Further, it cannot remove Latitude and Longitude properties from geopoint and geoshape objects, nor X and Y properties from mappoint and mapshape objects.

Examples

collapse all

Create a geopoint vector with dynamic properties.

gp = geopoint([42 42.2],[-110.5 -110.7],'Temperature',[65.6 63.2],'Humidity',[44 41])
gp = 
 2x1 geopoint vector with properties:

 Collection properties:
       Geometry: 'point'
       Metadata: [1x1 struct]
 Feature properties:
       Latitude: [42 42.2000]
      Longitude: [-110.5000 -110.7000]
    Temperature: [65.6000 63.2000]
       Humidity: [44 41]

Remove only the Humidity property from the geopoint vector.

gp2 = rmfield(gp,'Humidity')
gp2 = 
 2x1 geopoint vector with properties:

 Collection properties:
       Geometry: 'point'
       Metadata: [1x1 struct]
 Feature properties:
       Latitude: [42 42.2000]
      Longitude: [-110.5000 -110.7000]
    Temperature: [65.6000 63.2000]

Create a mapshape vector.

ms = mapshape(shaperead('tsunamis'))
ms = 
 162x1 mapshape vector with properties:

 Collection properties:
       Geometry: 'point'
       Metadata: [1x1 struct]
 Vertex properties:
  (162 features concatenated with 161 delimiters)
              X: [1x323 double]
              Y: [1x323 double]
 Feature properties:
           Year: [1x162 double]
          Month: [1x162 double]
            Day: [1x162 double]
           Hour: [1x162 double]
         Minute: [1x162 double]
         Second: [1x162 double]
       Val_Code: [1x162 double]
       Validity: {1x162 cell}
     Cause_Code: [1x162 double]
          Cause: {1x162 cell}
         Eq_Mag: [1x162 double]
        Country: {1x162 cell}
       Location: {1x162 cell}
     Max_Height: [1x162 double]
       Iida_Mag: [1x162 double]
      Intensity: [1x162 double]
     Num_Deaths: [1x162 double]
    Desc_Deaths: [1x162 double]

Attempt to remove multiple properties from the mapshape vector.

s2 = rmfield(ms,{'Geometry','Second','Minute','intensity'})
s2 = 
 162x1 mapshape vector with properties:

 Collection properties:
       Geometry: 'point'
       Metadata: [1x1 struct]
 Vertex properties:
  (162 features concatenated with 161 delimiters)
              X: [1x323 double]
              Y: [1x323 double]
 Feature properties:
           Year: [1x162 double]
          Month: [1x162 double]
            Day: [1x162 double]
           Hour: [1x162 double]
       Val_Code: [1x162 double]
       Validity: {1x162 cell}
     Cause_Code: [1x162 double]
          Cause: {1x162 cell}
         Eq_Mag: [1x162 double]
        Country: {1x162 cell}
       Location: {1x162 cell}
     Max_Height: [1x162 double]
       Iida_Mag: [1x162 double]
      Intensity: [1x162 double]
     Num_Deaths: [1x162 double]
    Desc_Deaths: [1x162 double]

The Second and Minute properties have been removed successfully. Note that the Geometry property still exists because it cannot be removed. Also, Intensity has not been removed because property names are case-sensitive.

Input Arguments

collapse all

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

Name of a single property to remove, specified as a character vector. The property in name is case sensitive.

Name of multiple properties to remove, specified as a cell array of character vectors. The properties in names are case-sensitive.

Output Arguments

collapse all

Output geographic or planar vector, returned as a geopoint, geoshape, mappoint, or mapshape object. The object type of vout matches the object type of vin.

See Also

| |

Introduced in R2012a