Convert degrees-minutes to degrees
converts angles from degrees-minutes representation to values in degrees which may
include a fractional part (sometimes called “decimal degrees”).
angleInDegrees = dm2degrees(
Convert Angle in Degree-Minutes to Degrees
dm = [ ... 30 44.78012; ... -82 39.90825; ... 0 -17.12345; ... 0 14.82000]; format long g angleInDegrees = dm2degrees(dm)
angleInDegrees = 4×1 30.7463353333333 -82.6651375 -0.285390833333333 0.247
DM — Angle in degrees-minutes representation
n-by-2 real-valued matrix
Angle in degrees-minutes representation, specified as an
n-by-2 real-valued matrix. Each row specifies one
angle, with the format
Dcontains the “degrees” element and must be integer-valued.
Mcontains the “minutes” element and may have a fractional part. The absolute value of
Mmust be less than 60.
For an angle that is positive (north latitude or east longitude) or equal to zero, all elements in the row must be nonnegative. For a negative angle (south latitude or west longitude), the first nonzero element in the row must be negative and the remaining value, if any, is nonnegative.
angleInDegrees — Angle in degrees
n-element column vector
Angle in degrees, returned as an
vector. The kth element
corresponds to the kth row of
For an input row with value
[D M], with integer-valued
D and real
M, the output value will be
SGN * (abs(D) + abs(M)/60)
SGNis 1 if
Mare both nonnegative and -1 if the first nonzero element of
[D M]is negative. An error results if a nonzero
Dis followed by a negative
Introduced in R2007a