Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Grouping into multiple folders from a single folder

2 Ansichten (letzte 30 Tage)
shivasakthi
shivasakthi am 13 Jan. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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.

Antworten (1)

Geoff Hayes
Geoff Hayes am 13 Jan. 2017
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.

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by