Need help creating simple plot (3d plot?)

조회 수: 1 (최근 30일)
Ulrik
Ulrik 2014년 10월 20일
댓글: Ulrik 2014년 10월 24일
"Draw the graph for the function s(x, y)=sin(pix)sin(piy). Let x=y=linspace(0, 4, n). Vary number of points, n, to see how this changes the surface."
I'm a newbie and I have no idea how to go about this. Any help would be greatly appreciated

채택된 답변

Mischa Kim
Mischa Kim 2014년 10월 20일
Ulrik, one option would be a surface plot:
n = 100;
x = linspace(0,4,n);
y = linspace(0,4,n);
[X,Y] = meshgrid(x,y); % create a x-y grid of data points
Z = sin(pi*X).*sin(pi*Y);
surf(X,Y,Z)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by