Mapping Toolbox | ![]() ![]() |
Convert the elements of dms format to distinct matrix elements
Syntax
Description
[d,m,s] = dms2mat(anglin) takes angles input in dms inputs and splits their components into three outputs, one each for degrees, minutes and seconds.
[d,m,s] = dms2mat(anglin,n) specifies the power of 10, n
, to which the resulting seconds output should be rounded (i.e., if a result is 12.567 seconds, and n
= -2, the resulting seconds output would be 12.57). The default value of n
is -5.
matout = dms2mat(anglin,n) returns a three-column matrix, matout
, in which the columns represent degrees, minutes, and seconds, respectively. In this case, anglin
must be a vector.
Examples
anglin = [12547.34; 54323.17]; [d,m,s] = dms2mat(anglin) d = 125 543 m = 47 23 s = 34 17 matout = dms2mat(anglin) matout = 125 47 34 543 23 17
See Also
mat2dms |
Convert from separated matrices to dms format |
![]() | dms2deg, dms2rad | dms2dm | ![]() |