Code covered by the BSD License  

Highlights from
Enhancing e-Infrastructures with Advanced Technical Computing: Parallel MATLAB® on the Grid

createSurface( n,distDim )
function [ a ] = createSurface( n,distDim )
%CREATESURFACE Creates a surface held in distributed arrays 

    indices = cell(2,1);
    indices(:,1) = {1:n};
    
    counter = codcolon(1,n);
    indices{distDim,1} = localPart(counter);
    
    [xgrid, ygrid] = ndgrid(indices{1},indices{2});
    
     a = 5*cos((xgrid+ygrid)*2*pi/n)+...
       2*sin(xgrid*2*pi)+2*cos(xgrid*2*pi/n);
   
     a = a + rand(size(a));
    
     a = codistributed(a,codistributor('1d', distDim));

end

Contact us at files@mathworks.com