Specifications
v
Plot Push Button Callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
Launching a Dialog to Confirm an Operation . . . . . . . . . . . . 5-9
Dialog Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
View the Layout and Application M-File . . . . . . . . . . . . . . . . . 5-10
Implementing the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
The Close Button Callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12
The Confirmation Dialog M-file . . . . . . . . . . . . . . . . . . . . . . . . 5-12
Launch the Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
Specify the Location of the Dialog . . . . . . . . . . . . . . . . . . . . . . . 5-14
Wait for User Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14
Executing a Callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15
Defining the Yes and No Buttons Callbacks . . . . . . . . . . . . . . 5-15
Protecting the GUI with a Close Request Function . . . . . . . . . 5-16
List Box Directory Reader . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
View the Layout and Application M-File . . . . . . . . . . . . . . . . . 5-18
Implementing the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-19
Specifying the Directory to List . . . . . . . . . . . . . . . . . . . . . . . . . 5-19
Loading the List Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21
The List Box Callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22
Accessing Workspace Variables from a List Box . . . . . . . . . 5-24
Techniques Used in This Example . . . . . . . . . . . . . . . . . . . . . . 5-24
View the Layout and Application M-File . . . . . . . . . . . . . . . . . 5-25
Reading Workspace Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25
Reading the Selections from the List Box . . . . . . . . . . . . . . . . . 5-26
A GUI to Set Simulink Model Parameters . . . . . . . . . . . . . . 5-28
Techniques Used in This Example . . . . . . . . . . . . . . . . . . . . . . 5-28
View the Layout and Application M-File . . . . . . . . . . . . . . . . . 5-28
How to Use the GUI (Text of GUI Help) . . . . . . . . . . . . . . . . . . 5-29
Launching the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30
Programming the Slider and Edit Text Components . . . . . . . . 5-31
Running the Simulation from the GUI . . . . . . . . . . . . . . . . . . . 5-33
Removing Results from the List Box . . . . . . . . . . . . . . . . . . . . 5-34
Plotting the Results Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35
The GUI Help Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-37
Closing the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-38
The List Box Callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-38