Okay, I have found this solution using the mesh function which works.
[X,Y] = meshgrid(x,y);
Z = fun(X,Y);% or Z - array double with size [length(x),length(y)]
mesh(X,Y,Z)
However, with the surf() function the surface is actually coloured. Can this be done with the mesh function aswell?