Effacer les filtres
Effacer les filtres

How to plot for this figure?

2 vues (au cours des 30 derniers jours)
soe min aung
soe min aung le 11 Fév 2021
Commenté : Star Strider le 11 Fév 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)

Réponse acceptée

Star Strider
Star Strider le 11 Fév 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 commentaires
soe min aung
soe min aung le 11 Fév 2021
Thank you so much sir.
Star Strider
Star Strider le 11 Fév 2021
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by