utm2deg
This function is based on UTMIP.m function by Gabriel Ruiz Martinez, but instead of providing a GUI it works with vectors of coordinates.
[Lat,Lon] = utm2deg(x,y,utmzone)
% Example 1:
% x=[ 458731; 407653; 239027; 230253; 343898; 362850];
% y=[4462881; 5126290; 4163083; 3171843; 4302285; 2772478];
% utmzone=['30 T'; '32 T'; '11 S'; '28 R'; '15 S'; '51 R'];
% [Lat, Lon]=utm2deg(x,y,utmzone);
% fprintf('%11.6f ',lat)
% 40.315430 46.283902 37.577834 28.645647 38.855552 25.061780
% fprintf('%11.6f ',lon)
% -3.485713 7.801235 -119.955246 -17.759537 -94.799019 121.640266
%
% Example 2: If you need Lat/Lon coordinates in Degrees, Minutes and Seconds
% [Lat, Lon]=utm2deg(x,y,utmzone);
% LatDMS=dms2mat(deg2dms(Lat))
%LatDMS =
% 40.00 18.00 55.55
% 46.00 17.00 2.01
% 37.00 34.00 40.17
% 28.00 38.00 44.33
% 38.00 51.00 19.96
% 25.00 3.00 42.41
% LonDMS=dms2mat(deg2dms(Lon))
%LonDMS =
% -3.00 29.00 8.61
% 7.00 48.00 4.40
% -119.00 57.00 18.93
% -17.00 45.00 34.33
% -94.00 47.00 56.47
% 121.00 38.00 24.96
Cite As
Rafael Palacios (2024). utm2deg (https://www.mathworks.com/matlabcentral/fileexchange/10914-utm2deg), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Mathematics and Optimization > Mapping Toolbox > Coordinate Reference Systems >
- Radar > Mapping Toolbox > Coordinate Reference Systems >
Tags
Acknowledgements
Inspired by: Conversion of UTM Coordinates to Spherical Coordinates
Inspired: Download elevations from Google Maps (API key required), utm2lonlat, LL2UTM and UTM2LL
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 | corrected m-Lint warnings |