GUIDE gui compatibility between 2015b and 2009b

1 view (last 30 days)
I have been working on a gui tool using GUIDE in 2009b and it has been functional in that environment. After making a trivial geometry edit in 2015b, I was worried to find that while my gui worked flawlessly in 2015b, it no longer could be run or edited in 2009b, resulting in a pile of errors:
??? Error using ==> hgload at 53
invalid Figure file format
Error in ==> openfig at 72
[fig, savedvisible] = hgload(filename, struct('Visible','off'));
Error in ==> gui_mainfcn>local_openfig at 286
gui_hFigure = openfig(name, singleton, visible);
Error in ==> gui_mainfcn at 159
gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible);
Error in ==> testgui at 42
gui_mainfcn(gui_State, varargin{:});
After doing a casual browse of the file contents and creating a test figure file, I notice that 2015b appends a hgM_070000 struct when any edits are made. Deleting this allows the gui to work in 2009b again.
I haven't yet found anything in documentation or bug reports about this. Is there a known incompatibility with older versions of Matlab, or is there something I can do to ensure compatibility beyond manually editing the file contents?
EDIT: After dredging the release notes, I see a long history of deprecated or altered functionality WRT gui development. With that in mind, I suppose it's probably expected that some things in particular are incompatible. The question still stands, though; this change to the file appears to break compatibility regardless of the gui content.
I'm wondering if it's even reasonable to bother using GUIDE as a crutch or if I'm better off just figuring out how to build everything programmatically. Alternatively, I suppose I could always just build the gui in 2009b and never ever touch it again for fear of making it error-bomb other users. If there's an intermediate choice, I'd be interested.

Accepted Answer

Walter Roberson
Walter Roberson on 1 Jun 2016
GUIDE has never been designed for backwards compatibility in what it generates.
In particular since R2014b it is likely to generate HG2 objects that cannot be read by older releases.
  1 Comment
DGM
DGM on 1 Jun 2016
I kind of had a feeling that was it. I'll probably try a programmatic approach, if not with this project, then the next. Thanks for the insight.

Sign in to comment.

More Answers (0)

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!