duration

Methods

Method Reference: duration.mldivide

duration: C = mldivide (A, B)

Left division of duration arrays, A \ B.

C = mldivide (A, B) divides B by A. The denominator A decides what the result means and must be a scalar. Dividing a duration by a number scales it, giving a duration; dividing one duration by another gives how many times one goes into the other, a plain number carrying no unit. A zero denominator gives Inf, as it does for numbers.

Dividing a number by a duration is not defined, having no meaning, and neither is a non-scalar denominator. The display format of a duration result is that of B.

Unlike MATLAB, an integer denominator is accepted and converted, as it is by rdivide and times here; MATLAB requires a double while accepting a logical, which the same rule cannot explain.

Source Code: duration