How to calculate the slope from geopraphical coordinates?
Mostrar comentarios más antiguos
Hi all,
I have installed a GPS logger on a vehicle, so I have extracted the geographcal coordinates in degree (longitude, latitude and elevation). I need to calculate the slope encountered by the vehicle. I came up with the following code, that is far from being good as you can see in the attached plot. How may I improve the results?
wgs84 = wgs84Ellipsoid('meters');
[gpsx,gpsy,gpsz] = geodetic2ecef(wgs84,Latitude,Longitude,Altitude);
slope=atand(diff(gpsz)./sqrt(diff(gpsx).^2+diff(gpsy).^2));
Thank you.
Best regards.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Standard File Formats en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

