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

constructs
an empty mappoint vector, `p`

= mappoint()`p`

, with these default
property settings:

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

For an additional example, see Construct a Default Mappoint Vector.

constructs
a new mappoint vector and assigns the `p`

= mappoint(`x`

,`y`

)`X`

and `Y`

properties
to the numeric array inputs, `x`

and `y`

.
For an example, see Construct a Mappoint Vector from X and Y Values.

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

= mappoint(`x`

,`y`

,`Name,Value`

)`Name`

, `Value`

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

. For an example,
see Construct a Mappoint Vector from X, Y, and Temperature Values.

constructs
a new `p`

= mappoint(`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. For an example, see Construct a Mappoint Vector from a Structure Array.

constructs
a new `p`

= mappoint(`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`

.
For an example, see Construct a Mappoint Vector from X and Y Numeric Arrays and
a Structure Array.

Construct a mappoint vector with dynamic properties using comma-separated
pairs of `Name,Value`

arguments. `Name`

is
the name of the dynamic property and `Value`

is the
corresponding value. `Name`

must appear inside single
quotes (`' '`

). You can specify several dynamic properties
as `Name1,Value1,...,NameN,ValueN`

.

If `Value`

is specified as a numeric, logical,
character vector, or cell array of character vectors, then the property
is designated a Feature property. If `Value`

is any
other type, then the field is ignored and no dynamic property `Name`

is
added to the mappoint vector.

append | Append features to mappoint vector |

cat | Concatenate mappoint vectors |

disp | Display mappoint vector |

fieldnames | Return dynamic property names of mappoint vector |

isempty | Return true if mappoint vector is empty |

isfield | Return true if dynamic property exists |

isprop | Return true if property exists |

length | Return number of elements in mappoint vector |

properties | Return property names of mappoint vector |

rmfield | Remove dynamic property from mappoint vector |

rmprop | Remove properties from mappoint vector |

size | Return size of mappoint vector |

struct | Convert mappoint vector to scalar structure |

vertcat | Vertically concatenate mappoint vectors |

Value. To learn how value classes affect
copy operations, see Copying Objects (MATLAB) in
the MATLAB^{®} documentation.

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?