keep few images and delete the rest in a folder
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Elysi Cochin
el 4 de Ag. de 2022
Editada: Elysi Cochin
el 4 de Ag. de 2022
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 comentarios
Respuesta aceptada
Walter Roberson
el 4 de Ag. de 2022
dels = setdiff(1:length(all_files), b);
arrayfun(@(idx)delete(all_files{idx}), dels);
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!