User`s guide

A GUI to Set Simulink
®
Model Parameters (GUIDE)
Bring t he GUI forwa rd so it is display e d on t op of the Simulink diagrams
(
figure).
Set the block param eters to match the current settings in the GUI.
Here is the code for the
model_open subfunction:
function model_open(handl es)
if isempty(find_system('Name','f14')),
open_system('f14'); open_s ystem('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 co mpensator',...
'Numerator',...
get(handles.KiCurrentValue,'String'))
end
Program the Slider and Edit Text Components
In the GUI, each slider is coupled to an edit text component so that:
The edit text displays th e cu rrent value of th e slider.
Theusercanenteravalueintotheedittextboxandcausethesliderto
update to that value.
Both components update the appropriate model parameters when activated
by the user.
Slider Callback
The GUI uses two sliders to specify block gains because these components
enable the selection of continuous values within a specified range. When a
user changes the slider value, the callback executes the following steps:
Calls
model_open to ensure that the Simulink model is open so that
simulation parameters can be set.
Gets the new slider value.
10-71