Main Content
Tune Inlined Parameters by Using MATLAB® Language
You can tune inlined parameters through the MATLAB interface.
Note: Simulink® Real-Time™ does not support parameters of multiword data types.
Open the Model
You must have already built and downloaded the model slrt_ex_osc_inlined
. To open this model, in the MATLAB Command Window, type:
model = 'slrt_ex_osc_inlined';
open_system(model);
Tune Inlined Parameter
With the real-application slrt_ex_osc_inlined
already running, you can tune inlined parameter A by using the setparam function.
1. Save the following code in a MATLAB file. For example, change_inlineA
.
tg = slrealtime; connect(tg); modelSTF = getSTFName(tg); set_param(model,"SystemTargetFile",modelSTF); A = 4; evalc('slbuild(model)'); load(tg,model); setparam(tg,'','A',2);
2. Execute that MATLAB file. Type:
change_inlineA
3. To see the new parameter value, type:
getparam(tg,'','A')
ans = 2
Close the Model
bdclose(model);