Convert string type angular coordinates into numerical decimal degrees.
txt can be a txt string or cellstr array containing one or more strings each representing an angular coordinate (latitude and/or longitude). str2angle is quite picky as regards input formats, see below.
If optional input argument verbose is set to 1 or true, str2angle will warn if the input cntains strings that couldn’t be converted. The default value is false (no warnings).
Output argument deg contains an 1xN array of numerical degree value(s. Unrecognizable input strings are either ignored or, if looking almost recognizable, set to NaN in the output.
The angular strings should look like:
So-called packed DMS and degrees/minutes/seconds separated by hyphens or minus signs are not accepted.
So, angular degree strings may look like e.g.:
191E21'3.1", 12e 22'33.24", 13E 23' 33.344", 14w24' 33.4444", 15S25'33.544", -16W26'33.644444'', 17s27'33.74444", 18N28'33.844", +19d29m33.944444s, 20D20M33.0444Se, 21°51'4.1", 22°52'44.25", 23° 53'33.34", 24°54' 33.44N", 25° 55' 33.544", 26°56'33.644''S, 27°57' 33.744'', 28°58'33844"w.
Note: the regular expression used to parse the input strings can be fooled. In particularly bad cases it may loose track completely and give up, angle2str returns an empty scalar Inf value then to distinguish from partly convertible inputs.
See also: angl2str.
Package: mapping