.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 2019-09-22T01:36:51Z by OpenModelicaOpenModelica 1.14.0~dev-26741-gf7ba6ee using GenerateDoc.mos