Problem to get the right format of a Surf Plot

1 visualización (últimos 30 días)
Cb
Cb el 26 de Feb. de 2021
Comentada: Star Strider el 8 de Mzo. de 2021
I am trying to plot a surface. What I need is the surface that is on top, but I keep getting the two surfaces underneath. Is there any reason why this is happening?
BB = [TBfunc1;TBfunc2]
X = [BB(:,1)]
Y = [BB(:,3)]
Z = [BB(:,2)]
[xi, yi] = meshgrid(X,Y);
F = scatteredInterpolant(X,Y,Z)
zi = F(xi,yi)
surf(xi,yi,zi, 'EdgeAlpha', 0)

Respuesta aceptada

Star Strider
Star Strider el 26 de Feb. de 2021
It looks as though ‘X’ is not sorted. Without the data a guess would be this possible solution:
BB = sortrows (BB,1);
See the documentation on sortrows for details.
  6 comentarios
Cb
Cb el 8 de Mzo. de 2021
Thank you again, for your support! I managed to fix it by myself. Is was an issue with the meshgrid size.
Star Strider
Star Strider el 8 de Mzo. de 2021
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by