# dotMultiply() Function & Examples

Use the dotMultiply() operators function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## dotMultiply

#### x .* y

#### dotMultiply(x, y)

Try it yourself:

```calculio
a = [1, 2, 3; 4, 5, 6]
b = [2, 1, 1; 3, 2, 5]
a .* b
```

[multiply](https://calcul.io/function/multiply/index.md)

[divide](https://calcul.io/function/divide/index.md)

---

## dotMultiply(): Element-Wise Products

**dotMultiply()** multiplies corresponding entries of compatible arrays or matrices. dotMultiply([2, 3], [4, 5]) returns [8, 15]. It is ideal for applying per-item weights, masks, conversion factors, or gains.

## Not matrix multiplication

This operation keeps matching positions independent. It differs from [multiply()](https://calcul.io/function/multiply/index.md), where matrix multiplication combines rows and columns, and from [dot()](https://calcul.io/function/dot/index.md), which reduces two vectors to one scalar. Check array shapes first with [size()](https://calcul.io/function/size/index.md).

Element-wise multiplication is often paired with [dotDivide()](https://calcul.io/function/dotDivide/index.md) for normalization and with [sum()](https://calcul.io/function/sum/index.md) for weighted totals. Make unit effects explicit: multiplying a quantity by a dimensionless weight differs from multiplying two physical measurements.

## Practical example

Multiply a sales vector by a per-product commission vector, then sum the result. This keeps the calculation transparent and avoids accidental matrix-product semantics.

[All functions](https://calcul.io/functions/index.md)
