Why Matlab 2016a savefig saves all other figures

2 views (last 30 days)
Hi all I have a Matlab software package that have a main GUI, and a lot of sub-GUIs. I discovered that in R2016a, whenever I savefig the subfigure, my main GUI got saved together, creating a huge fig file. I use object-oriented programming. For example, parent class contains the handle to main GUI and child class handle, while child class handle contains the handle of subfigure. I don't remember if it happens to previous version. But I just want to save the subfigure as a fig file and modify it later. I don't understand why Matlab bother to save the main GUI. And my main GUI contains a lot of java swing component, Matlab simply cannot serialize it, and give me a lot of warning. I just want to save a SINGLE figure, please help ...

Answers (1)

Tianxiao
Tianxiao on 28 Jun 2016
I figured out. My WindowKeyPressFcn had an handle class object as an argument. And this handle class object contains references to all other class objects... Apparently Maltab is now saving all figures contained in a variable.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!