to call objects like "Create Function" or "Callback" you have to open the Inspector of the figure you want to open inside a tab --> guide('yourFigure.fig'). Second, insert %automatic in the field of CreateFcn or Callback depending on what you want to be called. Afterwards, save your insertions and close the figure.
Now, if you try to add your existing figure as tab, it should work.
Elmar, great work!
Just one comment: I used it in Matlab R2013a, and the code cannot generate SelectionChangeFcn for buttongroup panel. Even I manually added the SelectionChangeFcn into the m file, it does not work in the GUI.
BTW, I have seen the comments by Syed Hussain and your response, but it may still not work for R2013a. Could you please provide a new version for the latest MATLAB? Thank you!
Under V2014B the table label is hidden by other objects. The work around it to add this piece of code at the opening of the GUI
p = handles.TBP_TabPanelContainer(2);
h = get(p,'Children');
set(p,'Children', [h(~ispanel) h(ispanel)]);
Does not work under Ubuntu 12.04, Matlab 2012a
Figure name has Upper and lower case
The tabpanel is called "tabPanel"
Calling tabpanel('My_Figure.fig', 'tabPanel')
creats a pop up message : file 'my_figure.fig' not found.
fh = openfig('My_Figure.fig');
1 0 0 -1 -1 -1 0 0