Main Content

cat

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

Concatenate heterogeneous arrays

Syntax

C = cat(dim,A1,A2,...,An)

Description

C = cat(dim,A1,A2,...,An) concatenates two or more heterogeneous arrays (A1, A2, and so on) along the dimension dim to form the array C. The input arrays must be derived from the same root class of a matlab.mixin.Heterogeneous hierarchy.

  • If the input arrays are of the same class, the class of the concatenated array is also the same.

  • If the input arrays 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 array is the most specific superclass shared by the input arrays.

  • 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

Dimension along which to concatenate arrays, specified as a scalar positive integer.

Object arrays to concatenate. The input arrays must be derived from the same root class of a matlab.mixin.Heterogeneous hierarchy.

Attributes

Sealedtrue
Hiddentrue

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2011a