Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
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 commentaire
Adam
Adam le 24 Sep 2018
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.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 24 Sep 2018
You should consider using onCleanup()

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by