MATLAB: Running a gui from another gui with push button after compiling them

matlab gui

Hello,
I have two gui figures with no link between them. Before compiling them with deploytool I just made a push button in "figure1" that run the "figure2" by command open figure2.m,or figure2.fig or figure2.exe (it didn't matter what with condition that the both figures been in the same folder) and it work perfectly. But after I compiled the first figure (the main figure) this command didn't work anymore. I use Matlab version R2011b. Any ideas to solve this issue please? Thank you.

Best Answer

In figure1.m use
%#function figure2
so that the compiler knows that figure2 will be called upon. You might also need to add figure2.fig to the project.
Related Question