The ENU to ECEF conversion can be easily calculated like this:
You will have to calculate your ENU origin's ECEF coordinates as well. Here the phi and lambda values are the geographic latitude and longitude of your ENU origin, the x,y,z, your POI's ENU coordinates and X_r, Y_r, Z_r, the ECEF coordinates of your ENU origin.
Note that on an ellipsoid, the "...
Semi-major (ie a), Semi-minor (ie b), and Ellipsoid Height (ie h) must be in the same unit of length, eg all must be in meters, or all in feets, and etc.
Unit of measurement of X, Y, Z follow the unit of length of a, b, h.
By convention, ECEF X, Y, Z are always in meters.
To convert from orthometric (vertical datum-based) heights to ellipsoidal heights, you need to add the geoid height to your Google Map elevations. I am not exactly sure how Google uses LMSL, it might simply be based on a local or national vertical datum (maybe like Normalhöhennull in Germany), but seeing that your data comes from Google Maps, using the ...
Well, how about simply using a 3D CRS then? EPSG:4978 is an ECEF CRS based on EPSG:4326 and in widespread use as the core (3D) CRS for the GPS system.
ALTER TABLE <table>
ALTER COLUMN geom TYPE GEOMETRY(<TYPE>, 4978)
USING ST_Transform(ST_Force3D(<geog>::GEOMETRY, 4978))
should give you meter based XYZ (ECEF) coordinates ...
Within the geodetic community, a geoid is a equipotential surface that roughly matches mean sea level if there was no topography.
You might want to take a look at this IERS site on the difference between ITRS and ITRF. ITRS, International Terrestrial Reference System, is the theoretical world system, which is then realized using a set of control points ...
I think the difference here may be caused by a missing height info in one of your points. From what I checked, your coordinates in your example refer to an area at a height of about 500 meters.
If I remove this 500 m height info, I get an offset of 311m in X, 60m in Y and 387m in Z. So this could be a potential explanation for you discrepancy.
[The question asked about NED and ECEF, and their "distortions". While the question is "flawed", the confusion is real, and it deserves an attempt at clarifying it for the person who posted the question. The omission of (explaning) ECEF is intended.]
Another name for MATLAB's NED is the topocentric coordinate system. Going from (geodetic) lat/long/height to ...
I don't think you can. It's very unusual to work with cartesian coordinates in GIS, aside from if you're doing geodesy work.
You will need to convert these X, Y, Z coordinates to Lat, Lon (height) before importing into PostGIS.