I'm trying to animate two 3d plots at the same time but I keep getting flickering does anyone now of a workaround or how to prevent the flickering?
See code below: I'm using octave 4.0 on ubuntu 16.04 64bit
k1 = 1; %how many times you want wave to oscillate in x-dir
k2 = 1; %how many times you want wave to oscillate in y-dir
u = linspace(-pi,pi,30); %how many segments
v = linspace(-pi,pi,30); % how many segments
[x,y] = meshgrid(u,v); %how many segments
w_len=max(length(x))
for ii=1:180
z=sin(k2*x+(ii)*pi/180);
z2=-sin(k2*y+(ii)*pi/180);
surf(x,y,z);
drawnow
surf(x,y,z2);
drawnow
pause(.001)
end