duration

Methods

Method Reference: duration.ceil

duration: Y = ceil (D)
duration: Y = ceil (D, unit)

Round toward negative infinity for duration arrays.

Y = ceil (D) rounds each element of the duration array D to the smallest integer number of seconds not less than that element.

Y = ceil (D, unit) rounds each element of the duration array D to the smallest integer number of the specified unit of time not less than that element. unit must be one of the following values:

  • 'seconds' (default)
  • 'minutes'
  • 'hours'
  • 'days'
  • 'years'

Source Code: duration

Example: 1

ceil rounds a duration up to a whole unit.

 d = minutes (90)
d =
  duration

   90 min
 ceil (d, 'hours')
ans =
  duration

   120 min