How can i get one GUI to trigger another GUI?
Show older comments
I have two GUI's running together simulating the running of a ships engine room. The main GUI (GUI_1) runs a while loop, started with a button press, calculating stuff like fuel consumption, propeller thrust and ship speed. The while loop runs continuously while the button is pressed but has a 0.2 sec pause build in. In the second GUI (GUI_2) I would like to display additional data as well as plots of selected parameters calculated in the main GUI. I have managed to pass data between the GUI's with the setappdata getappdata method. Getting continuously updating data from GUI_2 to GUI_1 works fine because the getappdata is included in the while loop in GUI_1. I can get data from GUI_1 to GUI_2 but so far it only updates on activation of a button in GUI_2, not continuously. My question is how do I trigger GUI_2 to receive and display data from GUI_1 continuously (or at the same 0.2 sec iteration as GUI_1)?
I tried putting a while loop in GUI_2 but that made the program stall (I am guessing GUI_1 just waited for the GUI_2 loop to finish, which it did not do since there was no end to the loop)
The GUI's are created in GUIDE, no toolboxes are in use and I am running the r2015b academic version of MATLAB. Thank you for your help.
Accepted Answer
More Answers (1)
Jan
on 13 Feb 2017
0 votes
Instead of a while loop, a timer can trigger the updates more reliably in both GUIs.
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!