You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spm_Pec_resels.m
    path of file: ./repos/bspm/thirdparty/spm12
    
    the code of the file until where you have to start completion: function R = spm_Pec_resels(L,W)
% Returns the resel count for a point-list of voxels
% FORMAT R = spm_Pec_resels(L,W)
% L   - point list of voxels {in voxels}
% W   - smoothness of the component fields {FWHM in voxels}
% R   - vector of RESEL counts
%___________________________________________________________________________
%
% Reference : Worsley KJ et al 1996, Hum Brain Mapp. 4:58-73
%___________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Karl Friston
% $Id: spm_Pec_resels.m 1143 2008-02-07 19:33:33Z spm $


% Resel Counts
%---------------------------------------------------------------------------
L   = round(L);
Ex  = 0;
Ey  = 0;
Ez  = 0;
Fxy = 0;
Fxz = 0;
Fyz = 0;
C   = 0;
x   = L(1,:);
y   = L(2,:);
z   = L(3,:);
P   = length(x);
R   = zeros(1,4);

% characterize voxel space
%---------------------------------------------------------------------------
for i = 1:P
  d = any(~any([x - L(1,i) - 1;y - L(2,i) - 0;z - L(3,i) - 0]));
  if d
    Ex = Ex + 1;

    
function R = spm_Pec_resels(L,W)
% Returns the resel count for a point-list of voxels
% FORMAT R = spm_Pec_resels(L,W)
% L   - point list of voxels {in voxels}
% W   - smoothness of the component fields {FWHM in voxels}
% R   - vector of RESEL counts
%___________________________________________________________________________
%
% Reference : Worsley KJ et al 1996, Hum Brain Mapp. 4:58-73
%___________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Karl Friston
% $Id: spm_Pec_resels.m 1143 2008-02-07 19:33:33Z spm $


% Resel Counts
%---------------------------------------------------------------------------
L   = round(L);
Ex  = 0;
Ey  = 0;
Ez  = 0;
Fxy = 0;
Fxz = 0;
Fyz = 0;
C   = 0;
x   = L(1,:);
y   = L(2,:);
z   = L(3,:);
P   = length(x);
R   = zeros(1,4);

% characterize voxel space
%---------------------------------------------------------------------------
for i = 1:P
  d = any(~any([x - L(1,i) - 1;y - L(2,i) - 0;z - L(3,i) - 0]));
  if d
    Ex = Ex + 1;
    d  =     any(~any([x - L(1,i) - 0;y - L(2,i) - 1;z - L(3,i) - 0]));
    d  = d & any(~any([x - L(1,i) - 1;y - L(2,i) - 1;z - L(3,i) - 0]));
    if d
    Fxy = Fxy + 1;
    d   =     any(~any([x - L(1,i) - 0;y - L(2,i) - 0;z - L(3,i) - 1]));
    d   = d & any(~any([x - L(1,i) - 1;y - L(2,i) - 0;z - L(3,i) - 1]));
    d   = d & any(~any([x - L(1,i) - 1;y - L(2,i) - 1;z - L(3,i) - 1]));
    d   = d & any(~any([x - L(1,i) - 0;y - L(2,i) - 1;z - L(3,i) - 1]));
    if d
        C = C + 1;
    end