Chalkboard - v3.0.4
    Preparing search index...

    Function resize

    • Returns a matrix with the number of rows and columns changed.

      Parameters

      • matr: ChalkboardMatrix

        The matrix

      • rows: number

        The number of rows to change to or (if the cols parameter is blank) the number of rows or columns (the size) to change to

      • Optionalcols: number = rows

        The number of columns to change to

      Returns ChalkboardMatrix

      const result = Chalkboard.matr.resize([[1, 2], [3, 4]], 1, 4); // Returns [[1, 2, 3, 4]]