Main Content

vertcat

Vertically concatenate geographic or planar vectors

Description

v = vertcat(v1,v2,...) vertically concatenates the geographic or planar vectors v1, v2, and so on. If the class type of any property is a cell array, then the resultant field in the output v is also a cell array.

example

Examples

collapse all

Create three mapshape vectors. The second vector has two features and is size 2x1.

ms1 = mapshape(42, -110, 'Temperature', 65, 'Name', 'point1');
ms2 = mapshape({50, 50.1}, {-101 -101.4}, 'Temperature', {73.2 77}, ...
    'Name', {'point2','point3'});
ms3 = mapshape(42.1, -110.4, 'Temperature', 65.5, 'Name', 'point4');

Vertically concatenate the vectors into a single mapshape vector.

ms = vertcat(ms1, ms2, ms3)
ms = 
 4x1 mapshape vector with properties:

 Collection properties:
       Geometry: 'line'
       Metadata: [1x1 struct]
 Vertex properties:
  (4 features concatenated with 3 delimiters)
              X: [42 NaN 50 NaN 50.1000 NaN 42.1000]
              Y: [-110 NaN -101 NaN -101.4000 NaN -110.4000]
    Temperature: [65 NaN 73.2000 NaN 77 NaN 65.5000]
 Feature properties:
           Name: {'point1'  'point2'  'point3'  'point4'}

The concatenated mapshape vector ms is size 4x1 and has four features. Note that the property 'Temperature' is a Vertex property in ms because it is a Vertex property in ms2, even though it is a Feature property in ms1 and ms3.

Input Arguments

collapse all

Geographic or planar vectors to be concatenated, specified as one or many geopoint, geoshape, mappoint, or mapshape objects. All of v1, v2,… are the same type of object.

Output Arguments

collapse all

Concatenated geographic or planar vector, returned as a geopoint, geoshape, mappoint, or mapshape object. The object type of v matches the object type of v1,v2,....

Version History

Introduced in R2012a

See Also