zeros(): matrix
Create an array or matrix of all zeros.
Creates an array or matrix filled with zeros based on the specified dimensions. If no arguments are provided, it defaults to a 1x1 matrix.
Create a 1x1 matrix of zeros (default behavior)
Create a 1x1 matrix of zeros (default behavior)
import { assertEquals } from "jsr:@std/assert"; assertEquals(zeros(), [[0]]);
Create a 2x2 square matrix of zeros
Create a 2x2 square matrix of zeros
import { assertEquals } from "jsr:@std/assert"; assertEquals(zeros(2, 2), [[0, 0], [0, 0]]);
A matrix of zeros with the specified dimensions.
zeros(n: number): matrix
Create an array or matrix of all zeros.
Creates an array or matrix filled with zeros based on the specified dimensions. If no arguments are provided, it defaults to a 1x1 matrix.
Create a 1x1 matrix of zeros (default behavior)
Create a 1x1 matrix of zeros (default behavior)
import { assertEquals } from "jsr:@std/assert"; assertEquals(zeros(), [[0]]);
Create a 2x2 square matrix of zeros
Create a 2x2 square matrix of zeros
import { assertEquals } from "jsr:@std/assert"; assertEquals(zeros(2, 2), [[0, 0], [0, 0]]);
A matrix of zeros with the specified dimensions.
zeros(dims: array): matrix
Create an array or matrix of all zeros.
Creates an array or matrix filled with zeros based on the specified dimensions. If no arguments are provided, it defaults to a 1x1 matrix.
Create a 1x1 matrix of zeros (default behavior)
Create a 1x1 matrix of zeros (default behavior)
import { assertEquals } from "jsr:@std/assert"; assertEquals(zeros(), [[0]]);
Create a 2x2 square matrix of zeros
Create a 2x2 square matrix of zeros
import { assertEquals } from "jsr:@std/assert"; assertEquals(zeros(2, 2), [[0, 0], [0, 0]]);
dims: array
A matrix of zeros with the specified dimensions.
zeros(nrows: number,ncols: number,): matrix
Create an array or matrix of all zeros.
Creates an array or matrix filled with zeros based on the specified dimensions. If no arguments are provided, it defaults to a 1x1 matrix.
Create a 1x1 matrix of zeros (default behavior)
Create a 1x1 matrix of zeros (default behavior)
import { assertEquals } from "jsr:@std/assert"; assertEquals(zeros(), [[0]]);
Create a 2x2 square matrix of zeros
Create a 2x2 square matrix of zeros
import { assertEquals } from "jsr:@std/assert"; assertEquals(zeros(2, 2), [[0, 0], [0, 0]]);
A matrix of zeros with the specified dimensions.