Overwriting the folder in matlab
18 ビュー (過去 30 日間)
古いコメントを表示
I've created the folder to write images on it by the code
outputFolder = fullfile(cd, 'folder_name');
if ~exist(outputFolder, 'dir')
mkdir(outputFolder);
and I'm in need to overwrite the same folder for writing another set of images. Is there any way to delete all the existing images in the folder for writing new images???
0 件のコメント
採用された回答
その他の回答 (1 件)
Jason Ross
2013 年 1 月 29 日
2 件のコメント
Jason Ross
2013 年 1 月 29 日
It's easier and safer (IMHO) to delete the directory with everything in it and then re-create it if you want to protect yourself from cruft or some error condition that pops up later because some other file is left over from a previous run ... or the wildcard match missed a .PNG file (or pNG, pNG, PNg, .png~ etc) ... or some other weirdess happens.
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!