Built-in Array Functions

1 Array Dimension and Size Functions

The following examples illustrate built-in functions that return the number of dimensions of an array (ndims(A)), the sizes of its dimensions (size(A, i)), or the size of a specific dimension (size(A)).



1.1 Simulation of DimSize


Take a look at an array element value at time=1:





2 Dimensionality Conversion Functions

The following conversion functions convert scalars, vectors, and arrays to scalars or matrices by adding or removing 1-sized dimensions.



2.1 Simulation of DimConvert


Take a look at an array element value at time=1:





3 Specialized Constructor Functions

An array constructor function constructs and returns an array computed from its arguments. Most of the constuctor functions in the table below construct an array by filling in values according to a certain pattern.



3.1 Simulation of ConstructFunc


Take a look at an array element value at time=0:





4 Reduction Functions

An array reduction function "reduces" an array to a scalar value, i.e. computes a scalar value from the array.



4.1 Simulation of Reduce


Take a look at the value at time=0:





5 Matrix and Vector Algebra Functions

The following set of functions are rather common in matrix and vector algebra, but are not associated with any Modelica operator symbol.



5.1 Simulation of AlgebraFunc


Take a look at the value at time=0: