npm.io
2.0.5 • Published 5 years ago

matrix-of-ones

Licence
ISC
Version
2.0.5
Deps
0
Size
1 kB
Vulns
0
Weekly
0

matrix-of-ones

matrix-of-ones creates a matrix where every element is the same value.

Installation

Using npm:

$ npm install matrix-of-ones

Using yarn:

$ yarn add matrix-of-ones

Usage

const generateMatrix = require("matrix-of-ones");

const matrix1 = generateMatrix(3, 2); // matrix1 =  [[1, 1], [1, 1], [1, 1]]
const matrixA = generateMatrix(2, 3, "A"); // matrixA = [["A", "A", "A"], ["A", "A", "A"]]
License

ISC

Keywords