This difference occurs because MATLAB’s default reference ellipsoid is "International", not "WGS 84"
Although people often use UTM with WGS 84, UTM was originally specified to work the various ellipsoids in different parts of the world, and the toolbox honors this specification.
The following code is accurate to within a few centimeters.
mUtm=defaultm('utm');
mUtm.zone = '35T';
mUtm.geoid = almanac('earth','wgs84','meters');
mUtm=defaultm(mUtm);
[eastutm2,northutm2]=mfwdtran(mUtm,44.3536,28.4981);
diffnorth2=4912239-northutm2
diffeast2=619393.56-eastutm2
[lat, lon] = minvtran(mUtm, eastutm2,northutm2)
Note that starting in MATLAB 7.14 (R2012a), it is recommended to use the wgs84Ellipsoid function instead of almanac . To do so, replace the line containing the almanac function with the following:
mUtm.geoid = wgs84Ellipsoid('meters');
Best Answer