필터 지우기
필터 지우기

3D surface (sine wave)

조회 수: 25 (최근 30일)
simira atraqi
simira atraqi 2012년 3월 28일
답변: Gnaneswar Nadh satapathi 2015년 2월 1일
Hello, How can I create 3D surface (sine wave)and plote it? Thank you very much

채택된 답변

Kye Taylor
Kye Taylor 2012년 3월 28일
One possibility is to use the following:
k1 = 1; %how many times you want wave to oscillate in x-dir
k2 = 0; %how many times you want wave to oscillate in y-dir
[X,Y] = meshgrid(linspace(-pi,pi));
Z = cos(k1*X).*cos(k2*Y);
Change k1 and k2 for fun.

추가 답변 (2개)

Gnaneswar Nadh satapathi
Gnaneswar Nadh satapathi 2015년 2월 1일
x=-15:0.5:15; y=-15:0.5:15; [X,Y] = meshgrid(x,y); % greate rectangullar mesh R=sqrt(X.^2+Y.^2); %rasius k=1; % wave vector phi=0; % phase Z=sin(k*R+phi); surf(X,Y,Z); axis equal;

Sean de Wolski
Sean de Wolski 2012년 3월 28일
I'm not really clear on what you want:
This:
surf(bsxfun(@(x,y)sin(x)+sin(y),-pi:0.1:pi,(-pi:0.1:pi)'))
or this:
surf(sin(repmat(-pi:0.1:pi,100,1)))
or maybe this?
surf(bsxfun(@(x,y)sin(x)+y,-pi:0.1:pi,(-pi:0.1:pi)'))
Please clarify your question if you want more detail.

카테고리

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