Building a surface plot

1 visualizzazione (ultimi 30 giorni)
Tom
Tom il 23 Feb 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)

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by