User`s guide
getparamid
14-46
14getparamid
Purpose Get parameter index from parameter list
Syntax MATLAB command line
getparamid(target_object, 'block_name', 'parameter_name')
Arguments
Description getparamid returns the index of a parameter in the parameter list based on the
path to the parameter name. The names must be entered in full and are case
sensitive. Note, enter for
block_name the mangled name that Real-Time
Workshop uses for code generation.
Examples Get the parameter property for the parameter Gain in the Simulink block
Gain1, incrementally increase the gain, and pause to observe the signal trace.
id = getparamid(tg, 'Subsystem/Gain1', 'Gain')
for i = 1 : 3
set(tg, id, i*2000);
pause(1);
end
Get the property index of a single block.
getparamid(tg, 'Gain1', 'Gain')
ans = 5
See Also The xPC Target scope object method getsignalid.
The xPC target M-file demo scripts listed in “xPC Target Demos” on page 5-8.
Troubleshooting chapter question “Why Does the getparamid Function Return
Nothing?” on page 12-25.
target_object
Name of a target object. The default name is tg.
'block_name'
Simulink block path without model name.
'parameter_name'
Name of a parameter within a Simulink block.