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: er_smooth.m
    path of file: ./repos/bspm/thirdparty/spm12/toolbox/marsbar-0.44/examples/batch
    
    the code of the file until where you have to start completion: function er_smooth(subjroot, sesses, filt, fwhm)
% smooth images prior to analysis
%
% Inputs
% subjroot     - root directory containing session directories
% sesses       - cell array containing session subdirectories
% filt         - shell exp filter for selecting files
% fwhm         - FWHM in mm for smoothing
%
% $Id: er_smooth.m,v 1.1.1.1 2004/08/14 00:07:52 matthewbrett Exp $

nsesses = length(sesses);


    
function er_smooth(subjroot, sesses, filt, fwhm)
% smooth images prior to analysis
%
% Inputs
% subjroot     - root directory containing session directories
% sesses       - cell array containing session subdirectories
% filt         - shell exp filter for selecting files
% fwhm         - FWHM in mm for smoothing
%
% $Id: er_smooth.m,v 1.1.1.1 2004/08/14 00:07:52 matthewbrett Exp $

nsesses = length(sesses);

imgs = '';
for s = 1:nsesses
  dirn = fullfile(subjroot,sesses{s});
  % get files in this directory
  imgs = strvcat(imgs, spm_get('files', dirn, filt));
end