MATLAB Creating Graphical User Interfaces

(Barry) #1
UI for Setting Simulink Model Parameters

You can change either of the gains in one of the two ways:


1 Move the slider associated with that gain.


2 Type a new value into the Current value edit field associated with that gain.


The block's values are updated as soon as you enter the new value in the UI.


Run the Simulation


Once you have set the gain values, you can run the simulation by clicking the Simulate
and store results button. The simulation time and output vectors are stored in the
Results list.


Plot the Results


You can generate a plot of one or more simulation results by selecting the row of results
(Run1, Run2, etc.) in the Results list that you want to plot and clicking the Plot button.
If you select multiple rows, the graph contains a plot of each result.


The graph is displayed in a figure, which is cleared each time you click the Plot button.
The figure's handle is hidden so that only the UI can display graphs in this window.


Remove Results


To remove a result from the Results list, select the row or rows you want to remove and
click the Remove button.


Run the Program


The UI window is nonblocking and nonmodal because it is designed to be used as an
analysis tool.


Resize and Command-Line Settings


The UI has the following GUIDE options selected to control the resize and command-line
behavior. Select Tools > GUI Options to view these settings.



  • Resize behavior: Non-resizable

  • Command-line accessibility: Off

  • Check box items selected:

Free download pdf