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 次查看(过去 30 天)
显示 更早的评论
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 个评论
Geoff Hayes
2016-3-19
编辑:Geoff Hayes
2016-3-19
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dialog Boxes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!