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

4 views (last 30 days)
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
Stephen23
Stephen23 on 10 Jan 2017
@eli: how are you creating these files. Please show us your exact code.

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
eli
eli on 10 Jan 2017
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)

Sean de Wolski
Sean de Wolski on 10 Jan 2017
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.
eli
eli on 10 Jan 2017
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

Community Treasure Hunt

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

Start Hunting!