Your imagelist
is a cell array and therefore should be accessed using curly braces (instead of regular parentheses).
Replace
img = imread( imagelist(i) );
with
img = imread( imagelist{i} );
and see what happens.
PS,
It is best not to use i
as a variable name in Matlab.