MATLAB: How to stop tabs from opening when I create a new file

MATLABnew file tab

In my script, I create a lot of file (hundreds). At the end of the script, each file is opened in a tab in the editor. Is it possible to stop this from happening?
Thanks.

Best Answer

The files are opened in the line:
edit(newfile)
If you do not want them to be opened, simply omit this line.
If tis was your problem, you can find the solution by using the debugger and stepping through your code line by line until you find the command, which produces the unwanted effects.