.ModelicaReference.Operators.'fill()'

Information

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}

Generated at 2020-06-05T07:38:22Z by OpenModelica 1.16.0~dev-420-gc007a39