ConstantArray

ConstantArray[c,n]

generates a list of n copies of the element c.

ConstantArray[c,{n1,n2,}]

generates an array of nested lists containing copies of the element c.

Details

Examples

open all close all

Basic Examples  (3)

Make a vector of 10 c's:

In[1]:=
Click for copyable input
Out[1]=

Make a 3×4 array of c's:

In[1]:=
Click for copyable input
Out[1]=

Make an array out of blocks:

In[1]:=
Click for copyable input
Out[1]=

Scope  (4)

Applications  (3)

Properties & Relations  (3)

Introduced in 2007
(6.0)
|
Updated in 2008
(7.0)