Skip to content

Latest commit

 

History

History
66 lines (33 loc) · 868 Bytes

File metadata and controls

66 lines (33 loc) · 868 Bytes

Home > @josh-brown/vector > MatrixBuilder > ones

MatrixBuilder.ones() method

Constructs a matrix of the specified dimensions, consisting of all ones

Signature:

ones(shape: MatrixShape): M;

Parameters

Parameter

Type

Description

shape

MatrixShape

The shape of the matrix as a tuple [m, n]

Returns:

M

The new matrix

Example

const allOnes = matrixBuilder.ones(2, 3);

// [ 1 1 1 ]
// [ 1 1 1 ]