Delete documents before strarting the routine

10 vues (au cours des 30 derniers jours)
Javier Martinez
Javier Martinez le 13 Mar 2017
Commenté : Jan le 16 Mar 2017
My Matlab script creates three different documents (.txt documents and .xlsx document). Every time I run the script I have to erase those documents manually in order to avoid problems. Does someone know a "script" which will go at the beginning of my routine that will delete such documents before running the analysis? Thanks.

Réponse acceptée

Jan
Jan le 13 Mar 2017
Do tis for the wanted files:
if exist(FileName, 'file') == 2
delete(FileName);
end
  7 commentaires
Javier Martinez
Javier Martinez le 16 Mar 2017
It worked ! Nice thank you very much.
Jan
Jan le 16 Mar 2017
You are welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Construct and Work with Object Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by