saveas function saves more than one file type
조회 수: 5 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (1개)
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
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
참고 항목
카테고리
Help Center 및 File 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!