saveas function saves more than one file type

4 views (last 30 days)
For a reason that I cannot determine, if I try to save a figure as a .fig file using the saveas function (either from the command line or in the GUI), it saves my figure as a .fig , a .pdf , a .emf and a .png . Every time. No matter what I put in the command line, it always saves every file as all four of the above figure types.
Example:
saveas(gcf,'test','fig')
produces test.fig , test.emf , test.pdf and test.png
saveas(gcf,'test.fig')
produces test.fig.fig , test.fig.emf , test.fig.pdf and test.fig.png
If I go to save a new figure from the GUI as a figure file named test.fig , it saves the file as test.fig.fig , test.fig.emf , test.fig.pdf and test.fig.png . Making a change to the file and saving again (using "Save") saves changes to all four files.
Similarly, if I go to the "File" menu in the figure GUI and select "Save As..." and attempt to save my figure as a figure file named test.fig , it will save the figure as test.fig , test.emf , test.pdf and test.png.
I have not exhaustively tested saving as all other types of files, but if I specify to save as a .png or as a .emf it only saves the figure as those file types. This seems to happen only when I try to save as a .fig file. What could possibly be causing this?

Answers (1)

Titus Edelhofer
Titus Edelhofer on 23 Apr 2015
Hi Sarah,
that's strange, I've never seen this, and I can't reproduce it. Just to be sure: does your MATLAB installation may have a saveas.m defined that does this on purpose? Does
which saveas
show something like
MATLABInstallationFolder\toolbox\matlab\general\saveas.m
or something different?
Titus
  3 Comments
Titus Edelhofer
Titus Edelhofer on 23 Apr 2015
Then I guess there are two options:
  • You try to debug (set a breakpoint at the first line of saveas and go step by step).
  • You contact MathWorks technical support
because I don't have an idea what could be going on here ...
Titus
Sarah Daggett
Sarah Daggett on 23 Apr 2015
Thanks for taking a look! I am likely going to contact tech support because I am just tired of looking at this. I will post an answer once I have it.

Sign in to comment.

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!