Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How can I call the data from one GUI and display it in another GUI without saving the data in a txt file?
1 回表示 (過去 30 日間)
古いコメントを表示
Below are my file, i can load the image after i save my uploaded image and use 'imread' in MY second GUI but i want to display the data straight from the previous GUI after i click a button to another GUI. "untitled1.m" and "well.m" is my second GUI.
0 件のコメント
回答 (2 件)
Adam Danz
2018 年 9 月 25 日
編集済み: Adam Danz
2018 年 9 月 26 日
If your GUI was made using GUIDE, you can call any callback function within the GUI's m-file from outside of that file. Say your GUI's m-file is named myGUI.m with a function within the file named buttonCallback(). From outside of the file, you can execute the code
MyGUI('buttonCallback',hObject,eventData,handles,...)
which includes all inputs to the buttonCallback() function.
3 件のコメント
Stephen23
2018 年 9 月 26 日
編集済み: Stephen23
2018 年 9 月 26 日
"If your GUI was made using GUIDE, you can call any nested callback function ..."
GUIDE does not use nested functions, it only uses local functions. Not only that, the MATLAB documentation specifically states that nested functions are "Not recommended for GUIDE apps."
Stephen23
2018 年 9 月 26 日
編集済み: Stephen23
2018 年 9 月 26 日
This is simple using guidata, or setappdata and getappdata: instead of using the handle of the callback object as you normally would, you can pass it the handle of the graphics root, so that whatever you store there will be available to all graphics objects. Note that you should not store all of the GUI data (i.e. handles) in the root, just the few bits of data that you want to swap between GUI's, and these should probably be stored in a structure (much like handles).
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!