Convert degrees-minutes to degrees
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.7463 -82.6651 -0.2854 0.2470
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.
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