Delete documents before strarting the routine

조회 수: 12 (최근 30일)
Javier Martinez
Javier Martinez 2017년 3월 13일
댓글: Jan 2017년 3월 16일
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.

채택된 답변

Jan
Jan 2017년 3월 13일
Do tis for the wanted files:
if exist(FileName, 'file') == 2
delete(FileName);
end
  댓글 수: 7
Javier Martinez
Javier Martinez 2017년 3월 16일
It worked ! Nice thank you very much.
Jan
Jan 2017년 3월 16일
You are welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Construct and Work with Object Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by