duration

Methods

Method Reference: duration.mean

duration: M = mean (D)
duration: M = mean (D, dim)
duration: M = mean (D, vecdim)
duration: M = mean (D, 'all')
duration: M = mean (…, nanflag)
duration: M = mean (…, outtype)
duration: M = mean (…, 'Weights', W)

Compute the mean of the elements of a duration array.

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

Source Code: duration

Example: 1

mean averages the durations in an array, returning a duration.

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

    1 hr    2 hr    3 hr    4 hr    5 hr
 mean (d)
ans =
  duration

   3 hr