Categories &

Functions List

Function Reference: hours

datatypes: D = hours (X)

Fixed-time duration in hours.

D = hours (X) returns a duration array representing fixed-time duration hours equivalent to the values in X, which must be a numeric array.

hours is also available as a method for duration arrays, in which case it performs the opposite conversion.

See also: duration, years, days, minutes, seconds, milliseconds, duration.hours

Source Code: hours

Example: 1

hours builds a duration from a number of hours; fractional values are fine.

 hours (1.5)
ans =
  duration

   1.5 hr
 hours ([1, 2.5, 8])
ans =
  1x3 duration array

    1 hr    2.5 hr    8 hr