I understand that you need to convert X–Y coordinates defined on the GRS80-based / Unified CS (EPSG:5179) back into geographic WGS84 latitude and longitude, and that existing UTM-based helpers like utm2ll are giving you different results than expected.
The simplest approach in MATLAB is to use the Mapping Toolbox’s PROJ-based functions:
- Create the EPSG:5179 CRS object with “projcrs”.
- Invert your X–Y to lat–lon using “projinv”.
Follow the below code regarding execution:
% 1. Create the EPSG:5179 projected CRS object
p5179 = projcrs(5179, "Authority", "EPSG");
% 2. Your input X–Y in meters
X = 959200;
Y = 1952800;
% 3. Unproject to latitude and longitude (in degrees)
[lat, lon] = projinv(p5179, X, Y);
% 4. Display results
fprintf('Latitude: %.6f°\nLongitude: %.6f°\n', lat, lon);
For more clarifications refer to following documentation links:
- Projcrs : https://www.mathworks.com/help/map/ref/projcrs.html
- Projfwd: https://www.mathworks.com/help/map/ref/projcrs.projfwd.html
For version specific MATLAB documentation links type following commands in MATLAB command window:
web(fullfile(docroot, '/map/ref/projcrs.html'))
web(fullfile(docroot, '/map/ref/projcrs.projfwd.html'))
In case of any minute discrepancies between the obtained results and actual result refer to the following MATLAB answer link to understand why it is so:
Hope this helps you!