Delete documents before strarting the routine

15 visualizaciones (últimos 30 días)
Javier Martinez
Javier Martinez el 13 de Mzo. de 2017
Comentada: Jan el 16 de Mzo. de 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.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Construct and Work with Object Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by