"GITTO THAMPI" <firstname.lastname@example.org> wrote in message news:email@example.com... > 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);
So f1 starts with F:xylo\mov1\mov1seg1 and continues with F:xylo\mov1\mov1seg2, etc. [BTW you may be missing a \ just after F:]
That's NOT where you wanted to write the file. You're missing the separator between the directory name and the file name. Some comments:
1) You already have the first part of your STRCAT call; you defined it above as f1. Why recreate that string in your IMWRITE call? Just use f1! 2) You used FULLFILE in the construction of f1. Why didn't you use it instead of STRCAT? FULLFILE handles adding in the separator automatically.