How do I stop tabs from opening when I create a new file?

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.

2 Comments

@eli: how are you creating these files. Please show us your exact code.
eli
eli on 10 Jan 2017
Edited: eli on 10 Jan 2017
I added the file!

Sign in to comment.

 Accepted Answer

Jan
Jan on 10 Jan 2017
Edited: Jan on 10 Jan 2017
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.

1 Comment

It looks like it's working! I thought I needed the edit function to create a new file. Thank you!

Sign in to comment.

More Answers (1)

Using the fopen/fprintf/fclose workflow I don't know why they'd be open. Can you show us what you have?

2 Comments

eli
eli on 10 Jan 2017
Edited: eli on 10 Jan 2017
Well, it's a bit messy. The code is not clean. It starts line 84. It's a loop that creates a file for each iteration. The files created are associated to the variable 'fid2'. I close it at the end of the loop.
EDIT: I uploaded the wrong file. The file named 'plswork.m' should be the right one.
Sorry, I uploaded the wrong file. See edit above.

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Asked:

eli
on 10 Jan 2017

Commented:

eli
on 10 Jan 2017

Community Treasure Hunt

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

Start Hunting!