MATLAB: Renamed Gui keeps referring to old .m file

guirenaming

Hi, I made some some changes to a GUI and renamed it. In the .m file, I changed all occurrences of the old name to the new name. The GUI seems to function fine, but I get a number of errors upon opening the fig file which indicate that something is still trying to open/reference the old GUI or .m file. I get the same errors when filling in character fields when using the GUI. I get these errors:
??? Error using ==> struct2handle
Undefined function or method 'task'
for input arguments of type 'char'.
??? Error using ==> struct2handle
Error while evaluating uicontrol CreateFcn
The old GUI was called 'task.m' and 'task.fig'.
I can't find any references to the old name in the current GUIs .m file; how could it still be referencing the old files? What can I do about this?
Thanks in advance.
Paul

Best Answer

The .fig that was saved by GUIDE has some anonymous functions stored in it that refer to the old routine names. Because they are stored at the .fig and not in the .m it is not always easy to find them. Once you do find them, you need to change the appropriate property of the .fig to refer to the new name, using the object browser that GUIDE provides.
Related Question