Is there a way in Mathematica to create an n-dimensional vector, where each element is a given scalar? I have tried the Array
function, as the documentation center suggests for tensors, but it generates indexed values.
1 Answer
$\begingroup$
$\endgroup$
ArrayReshape[Range @ 6, {2, 3}] // MatrixForm
ArrayReshape[ConstantArray[1, 12], {2, 3, 2}] // MatrixForm
Or
ConstantArray[1, {2, 3, 2}]
(Same output)