So, I figured out how to call one gui from another and send back and forth information via varargin and varargout. However, right now I’m in a situation where I have two separate guis (one is not called from the other), and I believe I need some other method if I want to communicate between them.
More exactly, I’m making two GUIs that interact with Simulink. One GUI opens when the model is opened and keeps track of information. The other GUI will open when a block is double-clicked. I want to send information from this GUI to the information-tracking GUI.
So, from what I’ve searched, I can accomplish this either by using a Listener in the information-tracking GUI; or I can modify the variables in the information-tracking GUI directly using setappdata/getappdata or findall(0, …).
So far my attemps haven’t worked and I was wondering if I’m taking the write approach. Can someone point me in a direction? Let me know if I can provide more info!
I use the setappdata/getappdata method all the time for this sort of thing. Here is a general breakdown of what you do. When you create the figures give them a tag like this:
Anytime you need the handle to one or the other figures just make a call to findobj like this
Ok now lets store some example data in the info_gui that we will update later
Once you have your figures set up you can do things like this:
I like to store all of my figure appdata in one giant struct. Seems easier to keep track of but its up to you. Hope this helps 🙂