Creating Graphical User Interfaces | ![]() ![]() |
Launching the GUI
The GUI is nonblocking and nonmodal since it is designed to be used as an analysis tool.
Application Options Settings
This GUI uses the following application option settings:
Generate callback function prototypes
Application allows only one instance to run
Use system color scheme for background
Opening the Simulink Block Diagrams
This example is designed to work with the F14 Simulink model. Since the GUI sets parameters and runs the simulation, the F14 model must be open when the GUI is displayed. When the application M-file launches the GUI, it executes the model_open
subfunction. The purpose of the subfunction is to:
find_system
).open_system
).set_param
).figure
).This is the code for the model_open
subfunction:
function model_open(handles) if isempty(find_system('Name','f14')), open_system('f14'); open_system('f14/Controller') set_param('f14/Controller/Gain','Position',[275 14 340 56]) figure(handles.F14ControllerEditor) set_param('f14/Controller Gain','Gain',... get(handles.KfCurrentValue,'String')) set_param('f14/Controller/Proportional plus integral compensator',... 'Numerator',... get(handles.KiCurrentValue,'String')) end
![]() | How to Use the GUI (Text of GUI Help) | Programming the Slider and Edit Text Components | ![]() |