utm2lonlat

Version 1.0.0.0 (4.47 KB) by Erwin
Functions to convert vectors containing UTM coordinates into Lat/Lon vectors (WGS84) and vice versa
2.8K Downloads
Updated 8 Nov 2013

View License

This submission contains vecorised versions of the functions "utm2deg" and "deg2utm" by Rafael Palacios. The input/output-behaviour of both functions is identically.

We were able to achieve following speedup with input vectors of 40000 points:
- deg2utm: 1.3
- utm2deg: 3.3466

Basic usage:

[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

[x,y,utmzone] = deg2utm(Lat,Lon)

% Example 1:
% Lat=[40.3154333; 46.283900; 37.577833; 28.645650; 38.855550; 25.061783];
% Lon=[-3.4857166; 7.8012333; -119.95525; -17.759533; -94.7990166; 121.640266];
% [x,y,utmzone] = deg2utm(Lat,Lon);
% fprintf('%7.0f ',x)
% 458731 407653 239027 230253 343898 362850
% fprintf('%7.0f ',y)
% 4462881 5126290 4163083 3171843 4302285 2772478
% utmzone =
% 30 T
% 32 T
% 11 S
% 28 R
% 15 S
% 51 R

Cite As

Erwin (2024). utm2lonlat (https://www.mathworks.com/matlabcentral/fileexchange/44242-utm2lonlat), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: utm2deg, deg2utm

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