plotting four variable using meshgrid for 3 variables, but i am getting error
Info
This question is locked. Reopen it to edit or answer.
Show older comments
t=0.2;
p=1;
for kx = -3:.1:3
q=1;
for ky = -3:.1:3
r=1;
for kz = -3:.1:3
energy_ary(p,q)= -2*t*(cos(kx)+cos(ky)+cos(kz));
z_ary(r)= kz;
r=r+1;
end
y_ary(q)= ky;
q=q+1;
end
x_ary(p)=kx;
p=p+1;
end
x = x_ary ;
y = y_ary ;
z = z_ary ;
[XX,YY,ZZ] = meshgrid(x,y,z);
EE = energy_ary' ;
surf(XX,YY,ZZ,EE) ;
hold all
1 Comment
Rena Berman
on 5 Jun 2024
(Answers Dev) Restored edit
Accepted Answer
More Answers (0)
This question is locked.
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!