User`s guide
R2007a
17-4
element and is integer-valued. The third column contains the “seconds” element, and
may have a nonzero fractional part. Similarly, DM inputs and outputs are two-column
vectors with integer degrees and fractional minutes parts.
The new conversion functions dispense with the DMS encoding used in prior versions
of the toolbox. These represented DMS angles by a single real number, the format of
which is dddmm.ss. Such an encoding is no longer used internally by Mapping Toolbox
functions, as it is not self-documenting and can lead to erroneous computations. For
example, two DMS-encoded real numbers cannot be added to obtain a meaningful result.
Compatibility Considerations
DM and DMS representations are widely used in published reports and can occur in
geodata that you want to read into the MATLAB workspace. You can still import and
export DM and DMS data, but Mapping Toolbox functions no longer accepts the old
encodings as alternatives to floating point representations of latitude and longitude for
internal manipulations.
The scalar DM and DMS encodings are being eliminated from the toolbox because they
were never used for internal computations, and always had the potential to generate
serious numerical errors if passed accidently to functions that expected normal latitude-
longitude tuples. They also made the functions that accepted them less efficient due
to the need to convert from DM or DMS to fractional latitudes and longitudes before
processing the input data.
The following existing functions (which all use scalar DMS encoding) are being retired.
They remain available but now issue warnings that they are obsolete when used:
• deg2dm — Instead use degrees2dm to convert degrees to degrees-minutes vector
• deg2dms — Instead use degrees2dms to convert degrees to degrees-minutes-seconds
vector
• dms2deg — Instead use dms2degrees to convert degrees-minutes-seconds vector to
degrees
• dms2mat — Instead use degrees2dms to convert degrees to degrees-minutes-seconds
vector
• dms2rad — Instead use dms2degrees to convert degrees-minutes-seconds vector to
degrees and call degtorad or multiply by pi/180
• mat2dms — Instead use dms2degrees to convert degrees-minutes-seconds vector to
degrees