Delete documents before strarting the routine

12 Ansichten (letzte 30 Tage)
Javier Martinez
Javier Martinez am 13 Mär. 2017
Kommentiert: Jan am 16 Mär. 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.

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Construct and Work with Object Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by