duration

Methods

Method Reference: duration.times

duration: C = times (A, B)

Element-wise multiplication for duration arrays.

C = times (A, B) is the equivalent of the syntax C = A .* B and returns the element-by-element multiplication product between the corresponding elements of input arrays A and B, one of which must be a numeric array and the other 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

times (.*) scales a duration by a numeric factor.

 hours (1.5) * 4
ans =
  duration

   6 hr

Element-wise scaling by an array yields an array of durations.

 minutes (30) .* [1, 2, 3]
ans =
  1x3 duration array

    30 min    60 min    90 min