'fill()'

fill()

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Return a Real, Integer, Boolean or String array with all elements equal

Syntax

fill(s, n1, n2, n3, ...)

Description

Returns the n1 x n2 x n3 x ... array with all elements equal to scalar or array expression s (ni >= 0). The returned array has the same type as s. Recursive definition:

fill(s,n1,n2,n3, ...) = fill(fill(s,n2,n3, ...), n1);
fill(s,n) = {s,s,..., s}

Examples

Real    mr[2,2] = fill(-1,2,2);  // = [-1,-1;-1,-1]
Boolean vb[3]   = fill(true,3);  // = {true, true, true}