isHeterogeneous
Class: coder.CellType
Namespace: coder
Determine whether cell array type represents heterogeneous cell array
Syntax
tf = isHeterogeneous(t)
Description
returns tf = isHeterogeneous(t)true if
the coder.CellType object t is
heterogeneous. Otherwise, it returns false.
Examples
Tips
coder.typeofdetermines whether the cell array type is homogeneous or heterogeneous. If the cell array elements have the same class and size,coder.typeofreturns a homogeneous cell array type. If the elements have different classes,coder.typeofreturns a heterogeneous cell array type. For some cell arrays, the classification as homogeneous or heterogeneous is ambiguous. For example, the type for {1 [2 3]} can be a 1x2 heterogeneous type. The first element is double and the second element is 1x2 double. The type can also be a 1x3 homogeneous type in which the elements have class double and size 1x:2. For these ambiguous cases,coder.typeofuses heuristics to classify the type as homogeneous or heterogeneous. If you want a different classification, use themakeHomogeneousormakeHeterogeneousmethods. ThemakeHomogeneousmethod makes a homogeneous copy of a type. ThemakeHeterogeneousmethod makes a heterogeneous copy of a type.The
makeHomogeneousandmakeHeterogeneousmethods permanently assign the classification as homogeneous and heterogeneous, respectively. You cannot later use one of these methods to create a copy that has a different classification.
Version History
Introduced in R2015b