Effacer les filtres
Effacer les filtres

I'm not sure which 3d plotting function would allow me plot elevation data as a function of GPS coordinates

3 vues (au cours des 30 derniers jours)
As stated above, I'm trying to find a 3d plotting function that allows me to plot elevation data vs map coordintes. I do not have any toolboxes for this purpose. I did this back in about 2006 or '07, but sadly that m-file was lost when a hard drive died. I ideally the function would allow colors to vary according to road grade. I only want to plot elevations for the points on the path.
Note that I'm not looking for help with my code. Importing data and then doing the analysis I want to do isn't a problem. It's just figuring out which 3d plotting function would achieve what I need. Also, the plot should be continuous and not discrete, interpolating between data points.
I've attached an image of a plot that mostly looks like what I'm trying to achieve, save for the reflection of the plot across the elevation=0 plane and the 2 grids.
Thanks in advance for any suggestions.

Réponses (1)

Voss
Voss le 20 Août 2023
Something like this might work. It's a surface.
x = [0 1 2.5 2 3 4 3 4 4 5 5];
y = [0 1.5 2.5 4 5 5 6 7 6 6 7];
z = [0 1 2 3 5 6 6 8 8 9 11];
c = [0 diff(z)./sqrt(diff(x).^2+diff(y).^2)]; % color is road grade
x(2,:) = x;
y(2,:) = y;
z(2,:) = 0;
c(2,:) = c;
surface(x,y,z,c,'FaceColor','interp')
view([-80 45])
box on
grid on
xlabel x
ylabel y
zlabel z
colormap([summer; flip(autumn,1)])
colorbar

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by