Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

append

Class: mappoint

Append features to mappoint vector

Syntax

outPoints = append(inPoints,x,y)
outPoints = append(___,field,value,...)

Description

outPoints = append(inPoints,x,y) appends the vector, x to the X property of the mappoint vector, inPoints, and the vector, y, to the Y property of inPoints.

outPoints = append(___,field,value,...) appends the values specified in value to the corresponding dynamic property, field. If the property does not exist, append adds the dynamic property to the object using the value of field for the name and assigning the field the value specified in value.

Input Arguments

inPoints

mappoint vector.

x

Numeric vector of X values, of class single or double.

y

Numeric vector of Y values, of class single or double.

field

Field name, specified as a character vector. Field can specify the name of an existing property in the mappoint vector or the name you want assigned to a new property that you want to add to the mappoint vector.

value

Value you want to assign to the property specified by field, specified as a cell array, scalar, or vector of any numeric class or logical.

  • When value is a cell array, append adds the property as a Vertex property.

  • When value is a numeric array, append adds the property as a Feature property.

  • When value is empty, append removes the property.

Output Arguments

outPoints

Modified mappoint vector with additional entries in X and Y fields along with any new fields for dynamic properties that you added.

Examples

expand all

Append values to existing fields of a mappoint vector.

p = mappoint(42,-110, 'Temperature', 65);
p = append(p, 42.1, -110.4, 'Temperature', 65.5)
p = 

 2x1 mappoint vector with properties:

 Collection properties:
       Geometry: 'point'
       Metadata: [1x1 struct]
 Feature properties:
              X: [42 42.1000]
              Y: [-110 -110.4000]
    Temperature: [65 65.5000]

Create mappoint vector and append dynamic property to it.

p = mappoint(42,-110, 'Temperature', 65);
p = append(p, 42.2, -110.5, 'Temperature', 65.6, 'Pressure', 100.0)
p = 

 2x1 mappoint vector with properties:

 Collection properties:
       Geometry: 'point'
       Metadata: [1x1 struct]
 Feature properties:
              X: [42 42.2000]
              Y: [-110 -110.5000]
    Temperature: [65 65.6000]
       Pressure: [0 100]
Was this topic helpful?