uitable and get/setappdata
5 ビュー (過去 30 日間)
古いコメントを表示
I have a uitable data which I need to transfer its content from one GUI to another. Following the well citied link: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
I used a Pushbutton with get/setappdata and I get an error (Reference to non-existent field 'quantTable'.), any reason why?
GUI1:
function transData_Callback(hObject, eventdata, handles)
handles.output = hObject;
setappdata(handles.quantTable,'data','datatable');
GUI2-under the OpeningFcn function:
my=getappdata(handles.quantTable,'datatable');
0 件のコメント
回答 (1 件)
Sean de Wolski
2013 年 4 月 8 日
More than likely the handles structure from the first GUI is not being passed to the second GUI. I.e. the second GUI is using its handles structure which does not have a quantTable field.
Thus when you call the second GUI, you need to pass in the handles structure from the first, and use it in the OpeningFcn.
From GUI1:
gui2(handles); %call gui2 and give it handles from itself
In GUI2, store it and use it!
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!