Create a geoshape vector, designating a dynamic 'Temperature'
property. The 'Temperature'
values are input as a cell array so that they belong to a single feature. This vector has one feature with three vertices.
s =
1×1 geoshape vector with properties:
Collection properties:
Geometry: 'line'
Metadata: [1×1 struct]
Vertex properties:
Latitude: [42 42.2000 43]
Longitude: [-110 -110.3000 -110.5000]
Temperature: [65 65.1000 65.2000]
Add three points to the geoshape vector, including a two new dynamic properties 'Precipitation'
and 'CloudCover'
. The latitude and longitude values are added as a two-element cell array, so two features are added to the geoshape vector. Note that the 'Temperature'
and 'Precipitation'
values are specified as two-element vectors, while the new 'CloudCover'
values are specified as a one-element cell array.
s2 =
3×1 geoshape vector with properties:
Collection properties:
Geometry: 'line'
Metadata: [1×1 struct]
Vertex properties:
(3 features concatenated with 2 delimiters)
Latitude: [42 42.2000 43 NaN 50 50.2000 NaN 60]
Longitude: [-110 -110.3000 -110.5000 NaN -120 -121 NaN -130]
Temperature: [65 65.1000 65.2000 NaN 60.2000 0 NaN 60.4000]
CloudCover: [0 0 0 NaN 20 80 NaN 0]
Feature properties:
Precipitation: [0 0.0700 0.1900]
This appended vector s2
now has three features, separated by NaN
, with some Vertex properties and some Feature properties. The two cells of the latitude and longitude cell arrays form the two newly-added features, one with two vertices and the other with one vertex. Since 'Temperature'
had previously been designated as a Vertex property in s
, the new 'Temperature'
values are added as Vertex properties. The 'Temperature'
value of one new point has not been assigned, so it is set to the default value of 0.
However, the new 'Precipitation'
and 'CloudCover'
properties are designated as a Vertex or Feature property, whichever is more appropriate for the value format. 'Precipitation'
values are provided as a two-element vector, so they are assigned as Feature properties, where each element of precip2
belongs to a separate feature of the geoshape vector. Since 'CloudCover'
values are provided as a cell array, the values must belong to the same feature, so they are set as Vertex properties corresponding to the first added feature. No 'CloudCover'
values have been specified for the second added feature, so vertices in the second feature are assigned the default value 0. Finally, 'Precipitation'
and 'CloudCover'
values for the original feature are set to the default value of 0.