Hi,
if you take a look at TestFiles(1).name you will see the ".", which is the current folder. Several possibilities: if you e.g. only have files with .jpg, you could write
TestFiles = dir(fullfile(FullPath, '*.jpg'));
or similar for other file formats. If you need all image files, be sure to not read "." and ".." by e.g.
if ~strcmp(TestFiles(i).name, '.') && ~strcmp(TestFiles(i).name, '..')
S = imread(...);
end
Titus