This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

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.


Class: matlab.mixin.Heterogeneous
Package: matlab.mixin

Vertical concatenation for heterogeneous arrays


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


C = vertcat(A1,A2,...) concatenates the matlab.mixin.Heterogeneous objects A1, A2, and so on, to form the array C. All input arrays must have the same number of columns.

The class of object arrays A1,A2,... must be derived from the same root class of a matlab.mixin.Heterogeneous hierarchy.

MATLAB® calls:

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

for the expression:

C = [A1;A2;...]

when A1 and A2, and so on are arrays of matlab.mixin.Heterogeneous objects.

If all input arguments are of the same specific 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 array's class is that of 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 left-most element in the concatenation if no other class is dominant).

The horzcat method is sealed in the class matlab.mixin.Heterogeneous and, therefore, you cannot override it in subclasses.

Input Arguments


Object array of class matlab.mixin.Heterogeneous


Object array of class matlab.mixin.Heterogeneous

Output Arguments


Array resulting from the specified vertical concatenation. The class of this array is that of the most specific superclass shared by the input arguments.



To learn about attributes of methods, see Method Attributes in the MATLAB Object-Oriented Programming documentation.

Was this topic helpful?