duration

Methods

Method Reference: duration.rdivide

duration: C = rdivide (A, B)

Element-wise right division for duration arrays.

C = rdivide (A, B) is the equivalent of the syntax C = A ./ B and returns the element-wise division of the duration array A by the corresponding elements of input array B, which can either be a duration or a numeric array. If B is a duration array, then C is a double numeric array. If B is a numeric array, then C is a duration array.

A and B must be size compatible, which translates to they can be the same size, one can be scalar, or for every dimension, their dimension sizes must be equal or one of them must be 1. The size of C is determined by the size compatibility of A and B.

Source Code: duration

Example: 1

rdivide (./) divides a duration by a number to scale it down.

 hours (3) ./ 2
ans =
  duration

   1.5 hr

Dividing one duration by another gives their dimensionless ratio.

 hours (3) ./ minutes (30)
ans = 6