Info

此问题已关闭。 请重新打开它进行编辑或回答。

Grouping into multiple folders from a single folder

1 次查看(过去 30 天)
I have 119 folders, each containing 46 images in .bmp format. Every two images (all images in perfect order, in all the folders) say image 1 and 2, image 3 and 4, and so on, belong to a particular class. So, I have 23 classes of images in each of these 119 folders. The task is to create 23 folders, corresponding to 23 classes that should contain the respective images ( i.e.) (image 1 and 2 from folder 1, image 1 and 2 from folder 2, ...., image 1 and 2 from folder 119, should go to the first of the 23 folders. Similarly, image 3 and 4 from folder 1, image 3 and 4 from folder 2, ...., image 3 and 4 from folder 119 should go the second of the 23 folder and so on). Kindly help me with the Matlab code for this. Thanks in advance.

回答(1 个)

Geoff Hayes
Geoff Hayes 2017-1-13
shivasakthi - what have you tried so far? This seems like homework so we can only give out hints. Start by writing out the pseudo-code for your algorithm to move the files. You will need to create folders, get a list of the 119 folders, get a list of all files in each folder, and then move each file to a specific folder. See mkdir, dir, movefile, and loop control statements which you can use to perform these tasks.

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by