keep few images and delete the rest in a folder
2 ビュー (過去 30 日間)
古いコメントを表示
Suppose I have 10 images, and i have saved all the pathname and filename in a variable all_files
I have a vector b = [ 2 4 6 ];
Now I want to keep only these images and delete all the other 7 images
How to keep those images and delete the rest?
0 件のコメント
採用された回答
Walter Roberson
2022 年 8 月 4 日
dels = setdiff(1:length(all_files), b);
arrayfun(@(idx)delete(all_files{idx}), dels);
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!