function files = listDir(folder, type)    
% Lists the contents of a directory.

contents = dir([folder type]);
numFiles = length(contents);
files = cell(1, numFiles);
for nFile = 1:numFiles
    files{nFile} = [folder contents(nFile).name];
end % nFile