Create a new NdArray filled with ones
SciPhp\NdArray
NumPhp::ones(
mixed
$tuple
)
$tuple
The new SciPhp\NdArray
use SciPhp\NumPhp as np;
$x = np::ones([2, 2]);
echo $x;
The above example will output:
[[1 1] [1 1]]
use SciPhp\NumPhp as np;
$x = np::ones(3, 3, 3);
echo $x;
The above example will output:
[[[1 1 1] [1 1 1] [1 1 1]] [[1 1 1] [1 1 1] [1 1 1]] [[1 1 1] [1 1 1] [1 1 1]]]