Convert degrees to degrees-minutes



DM = degrees2dm(angleInDegrees) converts angles from values in degrees which may include a fractional part (sometimes called “decimal degrees”) to degrees-minutes representation.


collapse all

angleInDegrees = [ 30.8457722555556; ...
                  -82.0444189583333; ...
dm = degrees2dm(angleInDegrees)
dm = 4×2

   30.0000   50.7463
  -82.0000    2.6651
         0  -30.2854
         0    0.2470

Input Arguments

collapse all

Angle in degrees, specified as an n-element real-valued column vector.

Output Arguments

collapse all

Angle in degrees-minutes representation, returned as an n-by-2 real-valued matrix. Each row specifies one angle, with the format [D M]:

  • D contains the “degrees” element and is integer-valued.

  • M contains the “minutes” element and may have a fractional part.

In any given row of DM, the sign of the first nonzero element indicates the sign of the overall angle. A positive number indicates north latitude or east longitude; a negative number indicates south latitude or west longitude. Any remaining element in that row has nonnegative values.

Introduced in R2007a