Building a surface plot

2 visualizaciones (últimos 30 días)
Tom
Tom el 23 de Feb. de 2013
Please would someone be willing to help me build a surface plot based on this code:
a = 5
b = 6
x = 1:a;
y = 1:b;
where z = sin(x/a)*sin(y/b)

Respuesta aceptada

Walter Roberson
Walter Roberson el 23 de Feb. de 2013
[X, Y] = meshgrid(x, y);
z = sin(X ./ a) * sin(y ./ b);
surf(x, y, z)
  1 comentario
Tom
Tom el 23 de Feb. de 2013
That's exactly what I wanted, many thanks.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D 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