How to create an 3D plot in matlab?

I have three single column matrix, containing longitude, latitude and height data. I need to plot trajectories, and I want that in 3D. how can I plot them in matlab using these location points?

Respuestas (1)

KSSV
KSSV el 12 de Dic. de 2018
Editada: KSSV el 12 de Dic. de 2018
Let x,y,z be your data.
% Option 1 / triangles
x = rand(10,1) ; y = rand(10,1) ; z = rand(10,1) ;
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
trisurf(tri,x,y,z)
% option 2 / interpolation
%
m = 10; n = 10 ;
xi = linspace(min(x),max(x),m) ;
yi = linspace(min(y),max(y),n) ;
[X,Y] = meshgrid(x,y) ;
%
F = scatteredInterpolant(x,y,z) ;
Z = F(X,Y) ;
surf(X,Y,Z)
Other possibilites also there..depending on your data. google for xyz2grid.

3 comentarios

Puspa patra
Puspa patra el 12 de Dic. de 2018
Thank you, it is creating a surface layer type of plot, what I want is just line tracs.
KSSV
KSSV el 12 de Dic. de 2018
Read about triplot, mesh, waterfall etc.....there are functions..it depends on your data.
Puspa patra
Puspa patra el 12 de Dic. de 2018
Thank you

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 12 de Dic. de 2018

Comentada:

el 12 de Dic. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by