copygraphics(fig)
copygraphics copy figure to clipboard.
x = -2:0.25:2; y = x; [X,Y] = meshgrid(x); F = X.*exp(-X.^2-Y.^2); surf(X,Y,F); copygraphics(gcf());