Code covered by the BSD License  

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

sampleFunctionNoAvg( b, sampleRate,sizeFull,distDim )
function [ b ] = sampleFunctionNoAvg( b, sampleRate,sizeFull,distDim )
%SAMPLEFUNCTION2 Summary of this function goes here
%    b = sampleFunction2(b,sampleRate,sizeFull,distDim);

% Set original size
     
     n = sizeFull(1);
     m = sizeFull(2);
     
% Set indices for original size, sampling every Sample Rate     
     
     indices = cell(2,1);
     indices(1,1) = {1:sampleRate:n};
     indices(2,1) = {1:sampleRate:m};

% Overwrite these indices for the distributed dimension
% Use codcolon to see which indices this lab contains

     counter = codcolon(1,n);
     
     counter1 = localPart(counter);
     counter2 = counter1(mod((counter1 - 1),sampleRate)==0);
     indices{distDim,1} = counter2 - counter1(1)+1;
     
% Using logical indices, just to get the points every sampleRate  

     b = b(indices{1},indices{2});

end

Contact us at files@mathworks.com