matlab坐标转换程序代码
时间: 2023-11-29 16:47:50 浏览: 83
根据提供的引用内容,我可以为您提供一个基于Mercantor投影和UTM坐标转换的MATLAB代码示例:
```matlab
function [x,y,utmzone] = deg2utm(Lat,Lon)
% -------------------------------------------------------------------------
% [x,y,utmzone] = deg2utm(Lat,Lon)
%
% Description: Function to convert lat/lon vectors into UTM coordinates (WGS84).
% Some code has been extracted from UTM.m function by Gabriel Ruiz Martinez.
%
% Inputs:
% - Lat: Latitude vector. Degrees. +ddd.ddddd WGS84
% - Lon: Longitude vector. Degrees. +ddd.ddddd WGS84
%
% Outputs:
% - x : UTM easting value in meters.
% - y : UTM northing value in meters.
% - utmzone : UTM longitudinal zone.
%
% Example:
% Lat=[40.3154333; 46.283900; 37.577833; 28.645650; 38.855550; 25.061783];
% Lon=[-3.485716667; 7.801233333; -119.95525; -17.75953333; -94.79901667; 121.6402667];
% [x,y,utmzone] = deg2utm(Lat,Lon);
% fprintf('%7.0f ',x)
% 458731 407653 239027 629656 343898 362850
% fprintf('%7.0f ',y)
% 4462881 5126290 4163083 3171843 4302285 2772478
% fprintf('%2s ',utmzone)
% S S 11S 28R 15S 51R
%
% Author:
% Rafael Palacios
% Universidad Pontificia Comillas
% Madrid, Spain
% Version: Apr/06, Jun/06, Aug/06, Aug/06
% Aug/06: error no 7 solved.
% Modified by:
% Gabriel Ruiz Martinez
% Universidad de Alicante
% Alicante, Spain
% -------------------------------------------------------------------------
```
阅读全文