How to move from one gui page to another by clicking push button?
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
researcher
le 21 Avr 2011
Réponse apportée : Savannah Morrissey Martin
le 11 Mai 2018
hi,I am new to matlab.I have a problem.I have created a simple gui page in matlab, it has a next button. Now I want to go to the next gui page by clicking on this button, such that first gui closes and next appears. What should I code in the callback? Do I need to use uicontrol? What exactly in the uicontrol?
something like this:
uicontrol('style','push','call','figure(''s.fig'',''new Figure'') close(gcbf)');
however this doe not seem to work..:(
0 commentaires
Réponse acceptée
Paulo Silva
le 21 Avr 2011
8 commentaires
Eslam Hamed
le 18 Déc 2015
Modifié(e) : Eslam Hamed
le 18 Déc 2015
Thanks a lot Paulo silva for this smooth and easy answer in your first comment, thanks matt for your addition, saved my day guys :))
Ankit Surti
le 2 Avr 2017
I'm getting this error can you help me with this?
Undefined function or variable 'welcomepage'.
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)welcomepage('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback.
even i want to implement the same concept but stuck with this error!!
Plus de réponses (3)
Matt Tearle
le 21 Avr 2011
I do this for things like help windows:
- Set the 'Tag' property in each window
- In the callback, use findobj to find the handle to the desired tag
- Check to see that it actually exists
- If so, use figure to make it active
Sample callback:
function showhelp(hObject,eventdata)
h_help = findobj('Tag','RCChelp');
if (isempty(h_help))
% Do something here -- window doesn't currently exist
else
figure(h_help);
end
end
You could simplify all this to figure(findobj('Tag','xxxx')), if you wanted to inline it.
1 commentaire
Image Analyst
le 11 Jan 2015
With R2014b you now have tabbed panels: http://www.mathworks.com/products/matlab/matlab-graphics/ : "Create user interfaces with tab panels with uitabgroup and uitab functions."
0 commentaires
Savannah Morrissey Martin
le 11 Mai 2018
Could you tell me how you set up your next button? I am trying to do something similar.
0 commentaires
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!