Equana

Back to NDArray Operations

mul

Linear algebra multiplication. For 2D matrices: matmul. For 2D×1D: mat-vec.

Syntax

mul(a: NDArray, b: NDArray) → r

Backends

TypeScriptnumwa

Description

Linear algebra multiplication. For 2D matrices: matmul. For 2D×1D: mat-vec. For 1D×1D vectors: element-wise. Scalar broadcasting supported.

Parameters

NameDescription
aLeft operand (NDArray or scalar)
bRight operand (NDArray or scalar)

Returns

NDArray result

Examples

Try It
>> mul([2, 3], [4, 5])
[8, 15] (1D element-wise)
Try It
>> mul(reshape([1,0,0,1], 2, 2), reshape([2,3,4,5], 2, 2))
matmul

Other Overloads