One approach:
[X,Y] = meshgrid(linspace(-5, 5, 50));
fcn = @(x,y,k) k*x.^2 + y.^2;
v = [1:-0.05:-1; -1:0.05:1];
for k1 = 1:2
for k2 = v(k1,:)
surf(X, Y, fcn(X,Y,k2))
axis([-5 5 -5 5 -40 60])
drawnow
pause(0.1)
end
end