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: aas_getimages.m
    path of file: ./repos/automaticanalysis/aa_engine
    
    the code of the file until where you have to start completion: % Automatic Analysis function to retrieve image lists
% function [imagefns]=aas_getimages(aap,i,j,prefixes,minimg,maximg)
%  select images from subject i session j
%  only images beginning with 'prefixes' are returned
%  either provide range using minimg, maximg (0,inf for all) or provide
%   single parame
    
function to retrieve image lists
% function [imagefns]=aas_getimages(aap,i,j,prefixes,minimg,maximg)
%  select images from subject i session j
%  only images beginning with 'prefixes' are returned
%  either provide range using minimg, maximg (0,inf for all) or provide
%   single parameter to get one image
% Rhodri Cusack MRC CBU Cambridge, Nov 2005

function [imagefns]=aas_getimages(aap,i,j,prefixes,minimg,maximg)

if (~exist('minimg','var'))
    minimg=0;
    maximg=inf;
else
    if (~exist('maximg','var')), maximg=minimg; end