Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Matrix initiate

Matias Vazquez-Levi edited this page Feb 1, 2021 · 2 revisions

Back to Matrix

initiate( value );

This function resets the matrix, all values are set to the same value.

  • value (optional)

    The value to be set through out the matrix. Is set to 0 by default



Example

const m1 = new Matrix(4,4);

m1.initiate(2);

m1.log();

output:

Matrix {
    rows: 4,
    cols: 4,
    matrix: [ 
        [ 2, 2, 2, 2 ],
        [ 2, 2, 2, 2 ],
        [ 2, 2, 2, 2 ],
        [ 2, 2, 2, 2 ] 
    ]
}
Clone this wiki locally