Creating Graphical User Interfaces |
Running the GUI
The GUI is nonblocking and nonmodal since it is designed to be used as an analysis tool.
GUI Options Settings
This GUI uses the following GUI option settings:
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 GUI M-file runs the GUI, it executes the model_open
subfunction. The purpose of the subfunction is to
find_system
).
open_system
).
set_param
).
figure
).
Here 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 |