Tutorial by Examples

Most advanced user interfaces require the user to be able to pass information between the various functions which make up a user interface. MATLAB has a number of different methods to do so. guidata MATLAB's own GUI Development Environment (GUIDE) prefers to use a struct named handles to pass da...
Sometimes we'd like to pause code execution to inspect the state of the application (see Debugging). When running code through the MATLAB editor, this can be done using the "Pause" button in the UI or by pressing Ctrl+c (on Windows). However, when a computation was initiated from a GUI (vi...
This is an example of a basic GUI with two buttons that change a value stored in the GUI's handles structure. function gui_passing_data() % A basic GUI with two buttons to show a simple use of the 'handles' % structure in GUI building % Create a new figure. f = figure(); ...
Two main techniques allow passing data between GUI functions and Callbacks: setappdata/getappdata and guidata (read more about it). The former should be used for larger variables as it is more time efficient. The following example tests the two methods' efficiency. A GUI with a simple button is cre...

Page 1 of 1