As Adam suggests you change the Matlab working directory to the location of your images, or what I mean is to force the user to select a file to read withuigetfile
>> [fn,pn]=uigetfile({'*.TIFF,*.jpg,*.bmp','Image files'}, 'Select an image');
>> I = imread(fullfile(pn,fn));
, , , , dir
>> imageDir = 'c:\path\to\my\images';
>> imageList = dir(fullfile(imageDir,'*.tif')); % store all files with extension tif
% in a structure array imageList
imageList . ,
uigetdir, , .