FUNCTION REFERENCE

hours

Duration in hours, or a duration as a number of hours.

Duration in hours, or a duration as a number of hours.

Syntax

d = hours(x)

Syntax

x = hours(d)

With numbers, a duration shown in hours; with a duration, the number of

hours it holds.

Example

d = hours(1.5)   % 1.5 hr

Example

x = hours(datetime(2024, 1, 2) - datetime(2024, 1, 1))   % 24

Differences from MATLAB: None known.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.