Effacer les filtres
Effacer les filtres

Mesh plot, not able to match size of Z and X

1 vue (au cours des 30 derniers jours)
ZAHID MALIK
ZAHID MALIK le 15 Avr 2023
Commenté : VBBV le 16 Avr 2023
t=0.2;
p=1;
for kx = -3:.1:3
q=1;
for ky = -3:.1:3
energy_ary(p,q)= -2*t*(cos(kx)+cos(ky));
y_ary(p,q)= ky;
q=q+1;
end
x_ary(p)=kx;
p=p+1;
end
x = x_ary ;
y = y_ary ;
[XX,YY] = meshgrid(x,y);
ZZ = energy_ary' ;
contourf(XX,YY,ZZ) ;

Réponses (1)

VBBV
VBBV le 15 Avr 2023
Modifié(e) : VBBV le 15 Avr 2023
t=0.2;
p=1;
for kx = -3:.1:3
q=1;
for ky = -3:.1:3
energy_ary(p,q)= -2*t*(cos(kx)+cos(ky));
y_ary(q)= ky;
q=q+1;
end
x_ary(p)=kx;
p=p+1;
end
x = x_ary ;
y = y_ary ;
[XX,YY] = meshgrid(x,y);
ZZ = energy_ary' ;
contourf(XX,YY,ZZ) ;
  2 commentaires
ZAHID MALIK
ZAHID MALIK le 16 Avr 2023
Thank you so much. I got it now
VBBV
VBBV le 16 Avr 2023
If that solved your problem, please accept the answer.

Connectez-vous pour commenter.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by