Filter löschen
Filter löschen

How to plot for this figure?

2 Ansichten (letzte 30 Tage)
soe min aung
soe min aung am 11 Feb. 2021
Kommentiert: Star Strider am 11 Feb. 2021
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)

Akzeptierte Antwort

Star Strider
Star Strider am 11 Feb. 2021
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
.
  2 Kommentare
soe min aung
soe min aung am 11 Feb. 2021
Thank you so much sir.
Star Strider
Star Strider am 11 Feb. 2021
As always, my pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by