saveas function saves more than one file type

조회 수: 5 (최근 30일)
Sarah Daggett
Sarah Daggett 2015년 4월 23일
댓글: Sarah Daggett 2015년 4월 23일
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?

답변 (1개)

Titus Edelhofer
Titus Edelhofer 2015년 4월 23일
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
Titus Edelhofer
Titus Edelhofer 2015년 4월 23일
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 2015년 4월 23일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by