How can I set the z axis for this plot? It changes with every iteration regardless of what the axis function tells it to do.
clear allclearclcx = linspace(0,2,30); %x data points
y = linspace(0,3,20); %y data points
[xgrid,ygrid] = meshgrid(x,y); %create grid of all x and y points
m=1;n=1;figure(3)axis squarebox ongrid ont= linspace(0,5,50);for k = 1:50axis([0 2 0 3 -5 5])animate = (576/(pi^6)).*((((1+((-1).^(m+1))).*(1+((-1).^(n+1))))/(m.^3.*n.^3)).*sin((m.*pi.*xgrid)/2).*sin((m.*pi.*ygrid)/3).*cos(pi.*t(k).*(sqrt(9.*(m.^2)+4.*(n.^2)))));surf(xgrid,ygrid,animate);pause(0.01);colormap jetbox onaxis([0 2 0 3 -5 5])end
Best Answer