Date: Dec 7, 2012 4:56 AM
Author: GITTO THAMPI
Subject: write images to different folders

i'm doing a work in frame extraction from video. i want to save the extracted frames to many subfolders that exists in a particular location(not current directory). I want to save the first 75 extracted frames in subfolder1, the next 75 frames in subfolder2, and so on... 
this is the code i have written..

xyloObj = mmreader('F:short\mov1.mpg');

nFrames = xyloObj.NumberOfFrames;
disp(nFrames);
n=1;
% Read one frame at a time.

for j = 1 : (nFrames/75)
foldername=strcat('mov1seg',int2str(j));
f1=fullfile('F:xylo\mov1\',foldername);
mkdir(f1);
for k=n: n+74
mov(k).cdata = read(xyloObj, k);
mov(k).colormap = [];
%imshow(mov(k).cdata);
imagename=strcat(int2str(k), '.jpeg');
imwrite(mov(k).cdata, strcat('F:xylo\mov1\mov1seg',int2str(j),imagename));

end
n=n+75;

end

i'm creating subfolders automatically in this code. my frames are getting saved to a single folder.
can someone help me to write the frames to the subfolders i created in this code one after another..