need to delete all mat files from all the folders at the end of execution.

1 次查看(过去 30 天)
Hi, How can I delete all mat file at the end of execution For example my program consists as follows
Function mfile
statement...
function one
DataPath = [pwd '\01_data\001_data\'];
statement...
end
function two
DataPath = [pwd '\02_Data\'];
statement...
end
function three
DataPath = [pwd '\03_Data' '\'];
statement...
end
function four
DataPath = [pwd '\04_Data\'];
statement...
end
function five
statement...
end
end
  • cán anyone help me how to solve this
  1 个评论
Adam
Adam 2018-9-24
Keep track of all the paths and then delete them using
doc delete
It isn't obvious from the code you post what setup you actually have. You just show a bunch of independent functions with no indication how they are called or if they return any arguments. If they don't then they should probably return the DataPath they use to enable you to keep track of it.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2018-9-24
You should consider using onCleanup()

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by