Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Planar point vector

A mappoint vector is a container object that holds planar point coordinates
and attributes. The points are coupled, such that the size of the *x*-
and *y*-coordinate arrays are always equal and match the size of any
dynamically added attribute arrays. Each entry of a coordinate pair and associated
attributes, if any, represents a discrete element in the mappoint vector.

`p = mappoint()`

`p = mappoint(x,y)`

`p = mappoint(x,y,Name,Value)`

`p = mappoint(structArray)`

`p = mappoint(x,y,structArray)`

`p = mappoint()`

constructs an empty mappoint vector,
`p`

, with these default property
settings:

p = 0x1 mappoint vector with properties: Collection properties: Geometry: 'point' Metadata: [1x1 struct] Feature properties: X: [] Y: []

`p = mappoint(`

constructs a new mappoint vector and assigns the `x`

,`y`

)`X`

and
`Y`

properties to the numeric array inputs,
`x`

and `y`

.

`p = mappoint(`

constructs a mappoint vector, then adds dynamic properties to the mappoint
vector using `x`

,`y`

,`Name,Value`

)`Name`

, `Value`

argument
pairs. You can specify several name-value pair arguments in any order as
`Name1,Value1,...,NameN,ValueN`

.

`p = mappoint(`

constructs
a new `structArray`

)`mappoint`

vector, assigning the fields of the structure
array, `structArray`

, as dynamic properties. Field values in
`structArray`

that are not numeric values, character
vectors, or cell arrays of numeric values or character vectors are
ignored.

`p = mappoint(`

constructs a new `x`

,`y`

,`structArray`

)`mappoint`

vector, sets the
`X`

and `Y`

properties equal to the
numeric arrays `x`

and `y`

, and sets
dynamic properties from the field values of
`structArray`

.

`append` | Append features to geographic or planar vector |

`cat` | Concatenate geographic or planar vector |

`disp` | Display geographic or planar vector |

`fieldnames` | Return dynamic property names of geographic or planar vector |

`isempty` | Determine if geographic or planar vector is empty |

`isfield` | Determine if dynamic property exists in geographic or planar vector |

`isprop` | Determine if property exists in geographic or planar vector |

`length` | Return number of elements in geographic or planar vector |

`properties` | Return property names of geographic or planar vector |

`rmfield` | Remove dynamic property from geographic or planar vector |

`rmprop` | Remove property from geographic or planar vector |

`size` | Return size of geographic or planar vector |

`struct` | Convert geographic or planar vector to scalar structure |

`vertcat` | Vertically concatenate geographic or planar vectors |

If

`X`

,`Y`

, or a dynamic property is set with more values than features in the mappoint vector, then all other properties expand in size using 0 for numeric values and an empty character vector (`''`

) for cell values.If a dynamic property is set with fewer values than the number of features, then this dynamic property expands to match the size of the other properties, by inserting a 0 if the value is numeric or an empty character vector (

`''`

), if the value is a cell array.If the

`X`

or`Y`

property of the mappoint vector is set with fewer values than contained in the object, then all other properties shrink in size.If either

`X`

or`Y`

is set to [ ], then both coordinate properties are set to [ ] and all dynamic properties are removed.If a dynamic property is set to [ ], then it is removed from the object.

The mappoint vector can be indexed like any MATLAB

^{®}vector. You can access any element of the vector to obtain a specific feature. The following examples demonstrate this behavior:

Was this topic helpful?