Main Content

vertcat

Class: matlab.mixin.Heterogeneous
Namespace: matlab.mixin

Vertically concatenate for heterogeneous arrays

Syntax

C = vertcat(A1,A2,...,An)

Description

C = vertcat(A1,A2,...,An) vertically concatenates two or more matlab.mixin.Heterogeneous object arrays (A1, A2, and so on) to form the array C. The input arrays must have the same number of columns.

When A1, A2, and so on are arrays of matlab.mixin.Heterogeneous objects, MATLAB® calls vertcat for this type of statement.

C = [A1;A2;...]
  • If all input arguments are of the same class, the class of the resulting array is unchanged.

  • If all input arguments are of different subclasses of a common superclass that is derived from matlab.mixin.Heterogeneous, then the result is a heterogeneous array. The class of the final array is the most specific superclass shared by all input arguments.

  • If all input arguments are not members of the same heterogeneous hierarchy, MATLAB calls the convertObjects method, if defined by the dominant root class (the first argument or the leftmost element in the concatenation if no other class is dominant). For more information, see Converting Nonmember Objects.

Input Arguments

expand all

Object arrays to concatenate. The object arrays must have the same number of columns.

Attributes

Sealedtrue
Hiddentrue

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2011a