MATLAB Answers

Building a surface plot

1 view (last 30 days)
Tom
Tom on 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)

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 23 Feb 2013
[X, Y] = meshgrid(x, y);
z = sin(X ./ a) * sin(y ./ b);
surf(x, y, z)

  1 Comment

Tom
Tom on 23 Feb 2013
That's exactly what I wanted, many thanks.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags

Products


Translated by