Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How can I call the data from one GUI and display it in another GUI without saving the data in a txt file?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Adam Danz
el 25 de Sept. de 2018
Editada: Adam Danz
el 26 de Sept. de 2018
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 comentarios
Stephen23
el 26 de Sept. de 2018
Editada: Stephen23
el 26 de Sept. de 2018
"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
el 26 de Sept. de 2018
Editada: Stephen23
el 26 de Sept. de 2018
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 comentarios
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!