Building a surface plot

2 Ansichten (letzte 30 Tage)
Tom
Tom am 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)

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by