MATLAB: Saving series of image

image processing

imwrite(imageArray,'C:\Users\Public\Videos\Sample Videos\pro\New','jpg');
this is my code to read series of image and save it to other directory
however i could not save it properly..
>> for k = 2 : 10
% Get the base file name.
baseFileName = sprintf('img%d.jpg', k);
% Combine it with the folder to get the full filename.
fullFileName = fullfile(folder, baseFileName);
% Read the image file into an array.
imageArray = imread(fullFileName);
figure,imshow(imageArray);
imwrite(imageArray,'C:\Users\Public\Videos\Sample Videos\pro\New','jpg');
end

Best Answer

See the FAQ for proper code that you can modify to do that: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F