p ='C:\MATLAB\R2010b';
q ='C:\MATLAB\R2010b\New folder';
fn = dir(fullfile(p,'*.jpeg'));
trh = 0.1;
for i = 1:length(fn)
jpeg = fn(i).name;
fullinputname = fullfile(p,jpeg);
fulloutputname = fullfile(q,jpeg);
[im7, im7map] = imread(fullinputname);
imwrite(im7,im7map, q);
procImage(fullinputname, trh);
end;
It is, though, not clear why you do not just copy the files to the new directory, cd() to it, and process the images there ?