- retrieve all filenames using dir
- create a random logical vector with 70% true, e.g. tf = randperm(N) > (0.70 *N), where N is the number of files
- create two new directories with mkdir
- loop over all files, using for
- use movefile to move the file to one folder, if the logical vector is true, otherwise move it to the other folder
How do I split a folder with images into two folders with images using MATLAB?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi, how are you. I have a question about images in a folder. I have a folder with multiple images (2000). How do I separate this folder into two folders with randomly chosen images? For example, 70% of images in one folder and 30% in another folder.
댓글 수: 0
답변 (1개)
Jos (10584)
2018년 2월 22일
편집: Jos (10584)
2018년 2월 22일
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Recognition, Object Detection, and Semantic Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!