I'm using a code to pass values between guis. The first time it worked flawlessly, but the second time it neither gave me the output nor an error. Please help!
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
This is the code I used. I found this answer submitted by Geoff Hayes in another similar question. The handle visibilty has been changed to on and the tags of my figures have been changed to their respective names. What am i doing wrong?
function pushbutton1_Callback(hObject, eventdata, handles)
% get the handle of Gui1
h = findobj('Tag','Gui1');
% if exists (not empty)
if ~isempty(h)
% get handles and other user-defined data associated to Gui1
g1data = guidata(h);
% maybe you want to set the text in Gui2 with that from Gui1
set(handles.text1,'String',get(g1data.edit1,'String'));
% maybe you want to get some data that was saved to the Gui1 app
x = getappdata(h,'x');
end
6 commentaires
Geoff Hayes
le 19 Mar 2016
Modifié(e) : Geoff Hayes
le 19 Mar 2016
Preethi - when you try to get the values from openingpagedemo, is this GUI still available (i.e. visible to the user) or have you closed it? If it has been closed, then you will not be able to obtain the length and width from it.
Réponses (0)
Voir également
Catégories
En savoir plus sur Dialog Boxes 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!