Convert angles to character array
str = angl2str(angle)
str = angl2str(angle,signcode)
str = angl2str(angle,signcode,units)
str = angl2str(angle,signcode,units,n)
str = angl2str(angle)
converts a numerical vector of angles in degrees to a character array. The purpose of this function is to make angular-valued variables into character vectors suitable for map display.
str = angl2str(angle,signcode)
specifies the method for indicating that a given angle is positive or negative, wheresigncode
is one of the following:
'ew' |
east/west notation; trailing 'e' (positive longitudes) or 'w' (negative longitudes) |
'ns' |
north/south notation; trailing 'n' (positive latitudes) or 's' (negative latitudes) |
'pm' |
plus/minus notation; leading '+' (positive angles) or '-' (negative angles) |
'none' |
blank/minus notation; leading '-' for negative angles or sign omitted for positive angles (the default value) |
str = angl2str(angle,signcode,units)
specifies the units and the output format of the returned angle, using the following values:
Units | Units of Angle | Output Format |
---|---|---|
'degrees' |
degrees | decimal degrees |
'degrees2dm' |
degrees | degrees + decimal minutes |
'degrees2dms' |
degrees | degrees + minutes + decimal seconds |
'radians' |
radians | decimal radians |
str = angl2str(angle,signcode,units,n)
uses the integern
to control the number of significant digits provided in the output.n
is the power of 10 representing the last place of significance in the number of degrees, minutes, seconds, or radians -- forunits
of'degrees
','degrees2dm'
,'degrees2dms'
, and'radians'
, respectively. For example, ifn = -2
(the default),angl2str
rounds to the nearest hundredth. Ifn = -0
,angl2str
轮到最近的整数. And ifn = 1
,angl2str
rounds to the tens place, although positive values ofn
are of little practical use. Note that this sign convention forn
is opposite to the one used by the MATLAB®round
function.