dotDivide

x ./ y

dotDivide(x, y)

Try it yourself:

See also:

dotDivide(): Element-Wise Division

dotDivide() divides matching entries of arrays or matrices. For example, dotDivide([10, 20], [2, 4]) returns [5, 5]. It is useful for normalization, ratios, and scaling each measurement independently.

Shape and zero checks

Inputs normally need compatible shapes, and every divisor entry must be nonzero. Inspect dimensions using size(); use equal() or filtering logic to identify zero entries before calculating. A single invalid denominator can invalidate a whole result.

dotDivide differs from divide(), whose matrix rules are mathematical division rather than entry-by-entry processing. The matching companion is dotMultiply(); applying it with the divisor can verify a result. Use map() when each entry needs additional custom handling.

Interpretation

Element-wise ratios retain the matrix shape, so label axes and units carefully. A ratio can be dimensionless, but it can also carry a derived unit when numerator and denominator differ.

Try Dot Divide in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions