File Exchange

## utm2lonlat

version 1.0 (4.47 KB) by

Functions to convert vectors containing UTM coordinates into Lat/Lon vectors (WGS84) and vice versa

Updated

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

Camino Fernandez

### Camino Fernandez (view profile)

Thanks!

##### MATLAB Release
MATLAB 8.0 (R2012b)