3D surface (sine wave)
Show older comments
Hello, How can I create 3D surface (sine wave)and plote it? Thank you very much
Accepted Answer
More Answers (2)
Gnaneswar Nadh satapathi
on 1 Feb 2015
1 vote
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
on 28 Mar 2012
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.
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!