constant_array function
A list of copies of a value.
How to write it
constant_array(x, n)
- x
- The value. Takes an expression.
- n
- How many copies. Takes a whole number.
Examples
constant_array(0, 3)In the solver,
Open in the solverconstant_array(0, 3)gives[0, 0, 0].
Related functions
- count
How many elements of a list equal a value.
- complement
The elements of a list that are in none of the others.
- dimensions
The size of a list or a matrix, level by level.
- apply
Replace the head of an expression, or the brackets of a list, with a function.
- drop
A list without its first elements.
- append
A list with an element added at the end.