Building a surface plot

1 vue (au cours des 30 derniers jours)
Tom
Tom le 23 Fév 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)

Réponse acceptée

Walter Roberson
Walter Roberson le 23 Fév 2013
[X, Y] = meshgrid(x, y);
z = sin(X ./ a) * sin(y ./ b);
surf(x, y, z)
  1 commentaire
Tom
Tom le 23 Fév 2013
That's exactly what I wanted, many thanks.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by