So I opened up SIMPLE.fig in guide and saved it as SIMPLE_Online.fig, this automatically created a new m-file called SIMPLE_Online.m.
The problem is, when I now run the SIMPLE_Online GUI it is linked to the original SIMPLE.m m-file even though guide automatically created a new m-file with the correct name.
Am I missing something here? How can I create the link between SIMPLE_Online.fig and SIMPLE_Online.m?
That should have worked, according to the most recent documentation, unless
you're using an older version of MATLAB. I don't remember when GUIDE
started performing the automatic callback updating when you used Save As to
rename your GUI.
http://www.mathworks.com/access/helpdesk/help/techdoc/creating_guis/f11-998352.html
If you are using an older version, you may need to search through your
objects for any whose callbacks refer to SIMPLE and modify them to use the
appropriate callback from SIMPLE_Online.
--
Steve Lord
sl...@mathworks.com
I'm running Matlab R2007b so you're right, that should have worked!
I went through the .m file and all the links were correct so I assumed the problem must be the .fig file. I couldn't find a way of editing any links in guide but I knew a .fig was basically a .mat and I found a rather messy solution:
1. Rename the .fig file as a .mat file
2. Load the .mat file into the workspace, this gives a structure containing all the data the GUI needs. Looking through this, none of the links had been updated.
3. Manually update any field containing "SIMPLE" to "SIMPLE_Online".
4. Save the structure as SIMPLE_Online.mat
5. Rename as SIMPLE_Online.fig (could probably combine these two steps)
6. Close Matlab, reopen and run SIMPLE_Online
All the links now seem to work, but I imagine this is a VERY dodgy way of updating things and it would be very easy to corrupt a file unless you knew exactly what you were doing.
Nick
I am using R2007b
Thanks,
Brandon
Going through the fig-made-mat file is extremely lengthy (with ~30
callbacks) and as Nick said, very error-prone.
Is there no way to do this automatically? Seems strange that the "save
as" does not update the callbacks.
Cheers,
Yoav