Stuart’s MATLAB Videos

Watch and Learn

Passing data between GUIDE callbacks without globals in MATLAB

Very often MATLAB users want to share data between different callbacks that they have in their MATLAB GUIs. This video shows a technique that is applicable for when the data being shared is already stored in the state of the GUI. Examples of data that is stored in the state of the GUI includes the state (checked or unchecked) of a checkbox or the string that is held in an edit box. This programming pattern is also good for having a variety of UIcontrols update the GUI in the same way.

If you are looking to share data between callbacks that is not stored in the state of the GUI, then this very old video should help. It shows you how to use GETAPPDATA and SETAPPDATA to share data in a MATLAB GUI.

  • print


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.