how to plot a 3d surface using a matrix

1 visualización (últimos 30 días)
Antonios Georgantas
Antonios Georgantas el 23 de Oct. de 2018
Comentada: Star Strider el 24 de Oct. de 2018
I have a matrix d = 6x181, each of the numbers comprising it being density. How can I draw a surface plot against p and m, where m=1:1:6 and s=0:20:181? There was a similar question in the forum addressing the case of a matrix M with equal dimensions, but it was unclear to me, how to model it for my situation. Any help would be greatly appreciated.

Respuesta aceptada

Star Strider
Star Strider el 23 de Oct. de 2018
Another option:
d = sin((1:6)' * (1:181) / 90); % Creates (6x181) Matrix
m = 1:6;
p = 0:20:181;
figure
surf(d)
set(gca, 'XTick',p, 'YTick',m)
xlabel('p')
ylabel('m')
  2 comentarios
Antonios Georgantas
Antonios Georgantas el 24 de Oct. de 2018
Thank you @Star Strider. This worked perfectly.
Star Strider
Star Strider el 24 de Oct. de 2018
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 23 de Oct. de 2018
See warp() which can accept arbitrary rectangular grid of coordinates including non uniform.

Categorías

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

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by