Method Reference: calendarDuration.times

calendarDuration: C = times (A, B)

Element-by-element multiplication for calendarDuration arrays.

C = times (A, B) is the equivalent of the syntax C = A .* B and returns the element-by-element multiplication product of inputs A and B. Either A or B must be a calendarDuration array and its complement must be a double array.

C is a calendarDuration array of the same size as the input arguments after the necessary (if required) expansion. 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.

Source Code: calendarDuration

Example: 1

times (.*) scales a calendar duration by an integer factor.

 q = calmonths (3)
q =
  calendarDuration

   3mo
 q * 4
ans =
  calendarDuration

   1y

Scaling by an array yields an array of durations.

 caldays (7) .* [1, 2, 3]
ans =
  1x3 calendarDuration array

    7d    14d    21d