MATLAB: GUI error after saving as in another name

anothererrorguinamesave

I have a GUI in name of 'gui1'. I saved it as 'gui2'. So, 'gui2.m' and 'gui2.fig' have been make. Now, when I run 'gui2.fig', it errors:
??? Error using ==> struct2handle
Undefined function or method 'gui1' for input arguments of type 'char'.
??? Error using ==> struct2handle
Error while evaluating uicontrol CreateFcn
I think when saving as 'gui2', callbacks of some objects (gui elements like push-button,…) remain on 'gui1'. There are too many elements (push-buttons,…) in GUI that I can't change callback of all of them one by one.
Is there any way for setting all objects callback to 'gui2' entirely?

Best Answer

Did you resave the GUI from within GUIDE? You have to, you cannot just rename it in an explorer window.
Related Question