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

Matrix set

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

Back to Matrix

set( matrix );

This function sets the matrix of a matrix object.

  • matrix

    A matrix formatted as an array containing arrays. The initial dimensions don't need to be the same as the new matrix dimensions.




Example

let m1 = new Matrix(3,3);

m1.log({table:true});
// outputs: 3x3 matrix

let matrix = [
    [1,0],
    [0,1]
];

m1.set(matrix);

m1.log({table:true});
// outputs: 2x2 matrix

Clone this wiki locally