MATLAB: Delete documents before strarting the routine

delete documents ;start of script

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.

Best Answer

Do tis for the wanted files:
if exist(FileName, 'file') == 2
delete(FileName);
end