random extraction of files from a folder
이전 댓글 표시
I have a folder of 12000 images (in bmp format). I would like to randomly extract 2000 images and store it in a different folder. How can i do that?
채택된 답변
추가 답변 (2개)
Adam
2017년 3월 16일
doc dir
can be used to give you a listing.
doc randperm
can be applied to your listing to select the random files. I don't have time (or inclination) to write the code for you though so feel free to ask further questions once you have made an attempt if you get stuck.
댓글 수: 1
Sivaramakrishnan Rajaraman
2017년 3월 16일
ES
2017년 3월 16일
0 개 추천
You can do a dir in that folder for a list of files. Use a random number generator of 2000 length.
Select the file based on the random number.
카테고리
도움말 센터 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!