duration

Methods

Method Reference: duration.abs

duration: B = abs (A)

Absolute value of the elements of a duration array.

B = abs (A) returns the absolute value of each element in the duration array A. The returned duration array B has the same size as the input array A.

Source Code: duration

Example: 1

abs returns the magnitude of a (possibly negative) duration.

 d = minutes (30) - hours (2)
d =
  duration

   -90 min
 abs (d)
ans =
  duration

   90 min