duration

Methods

Method Reference: duration.mode

duration: M = mode (D)
duration: M = mode (D, dim)
duration: M = mode (D, vecdim)
duration: M = mode (D, 'all')
duration: [M, F, C] = mode (…)

Compute the most frequently occurring value in a duration array.

This method overloads the core mode function for duration arrays. The functionality is identical to core mode function. Type help mode for more information.

Source Code: duration

Example: 1

mode returns the most frequent duration in an array.

 d = hours ([1, 2, 2, 3, 2])
d =
  1x5 duration array

    1 hr    2 hr    2 hr    3 hr    2 hr
 mode (d)
ans =
  duration

   2 hr