ParseLatLongStrings

Convert from DD:MM:SS strings to decimal numeric
30 Downloads
Updated 18 Sep 2017

View License

ParseLatLongStrings - convert from DD:MM:SS strings to decimal numeric
%
% Convert strings representing angles in colon-seperated
% Degree-Minutes-Seconds format to decimal degrees.
%
% Call as:
% [dec_out] = ParseLatLongStrings(flexible_in);
%
% All the following return -20.5:
%
% ParseLatLongStrings('-20:30:00.00')
% ParseLatLongStrings('20:30:00 S')
% ParseLatLongStrings('20:30:00 E')
% ParseLatLongStrings('-20:30:00 e') % not sure if this is ever used...
% ParseLatLongStrings('20:30 s')
% ParseLatLongStrings(-20.5) % ie will return numeric if passed numeric
%
% Cell-array inputs of all the above types are supported, as are
% multi-line character arrays of format:
% ParseLatLongStrings(['20:30 s' ; '30:30 n'])

Cite As

David Rayner (2024). ParseLatLongStrings (https://www.mathworks.com/matlabcentral/fileexchange/64447-parselatlongstrings), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Data Type Conversion in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0

title change