MATLAB: Duplicate plot in 4

3d plotsMATLABmatrix manipulation

I have this code:
[x,y] = meshgrid(-2:.2:2);
z = exp(-(x.^2 +y.^2));
surf(x,y,z);
colormap(hot)
And the image associated is:
but i want this one (i can create more matrix or concatenate x and y matrix):
any tip? Thanks

Best Answer

[x,y] = meshgrid(-2:.2:2);
z = exp(-(x.^2 +y.^2));
% Part 1
surf(x,y,z);
colormap(hot)
hold on
%

x2 = x+4 ;
y2 = y ;
z2 = z ;
surf(x2,y2,z2);
%
x3 = x ;
y3 = y+4 ;
z3 = z ;
surf(x3,y3,z3);
%
x4 = x2 ;
y4 = y3 ;
z4 = z ;
surf(x4,y4,z4);