How to plot for this figure?

2 次查看(过去 30 天)
x = -10:1:10;
y = linspace(-10,10);
[X,Y] = meshgrid(x,y);
f = cos(2*pi*X).*cos(2*pi*Y);
surf(X,Y,f)

采纳的回答

Star Strider
Star Strider 2021-2-11
Define the ‘x’ and ‘y’ vectors differently, then reduce the number of cycles in each direction. The grid lines on the surfaces are more of a callenge.
Experiment with this:
x = linspace(-10,10);
y = linspace(-10,10);
[X,Y] = meshgrid(x,y);
f = cos(2*pi*X/6).*cos(2*pi*Y/6);
surf(X,Y,f, 'EdgeColor','none')
hold on
idxv = 1:4:numel(x); % Index Vector For Grid Lines Plot
surf(X(idxv,idxv), Y(idxv,idxv), f(idxv,idxv), 'FaceAlpha',0, 'LineWidth',1.5)
hold off
.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by