View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Simulink-GUI Synchronization Example

4.6 | 8 ratings Rate this file 65 Downloads (last 30 days) File Size: 15.6 KB File ID: #26308 Version:
image thumbnail

Simulink-GUI Synchronization Example



07 Jan 2010 (Updated )

Demonstrates how to synchronize GUI and Simulink model settings when user alters one or the other

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

Developing Graphical User Interfaces that drive Simulink models is a relatively common practice that can be accomplished with calls to get_param, set_param, and other Simulink functions. However, it can be challenging to update settings in the GUI when the user opts to alter them in the model directly rather than working through the GUI. This can lead to mismatches in settings in the model and values in the GUI.
This example demonstrates certain techniques to accomplish synchronization between a model and GUI. Through the use of Model and Block callbacks, we will be able to
  1) Automatically open/close a GUI when opening/closing a model.
  2) Update a pushbutton string when the user pushes Play in Simulink.
  3) Update a pushbutton string when the simulation stops or the user pushes the Stop simulation button in Simulink.
  4) Update a checkbox value when a Manual Switch is updated in Simulink.

In this manner, we enable the user to make changes through the GUI or directly within Simulink without causing mismatches between the two. Commentary, annotation, and a readme are provided to further explain how this is accomplished.

Required Products Simulink
MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
06 May 2016 p_Suresh

18 Apr 2016 tiff

tiff (view profile)


12 Jun 2015 Suytry KY

12 Nov 2014 Ali Osman

28 Aug 2013 Srinivas

14 Aug 2013 Hao Huang

26 Jun 2013 taoufik wassar

10 Jan 2013 Tsinghua


Comment only
02 Feb 2010 1.1

Updated to R2009b

22 Feb 2010 1.2

Use findobj instead of referencing GUI objects by children index.

25 Feb 2010 1.3

Added a Gain block that can be controlled via Edit Box and/or Slider

25 Feb 2010 1.4

Fixed minor mistakes in hastily uploaded file.

01 Sep 2016

Updated license

Contact us