xPC Target | ![]() ![]() |
Get a parameter index or property name from the parameter list
Syntax
getparamid(target_object, 'block_name', 'parameter_name) getparamid(target_object, 'block_name', 'parameter_name', 'flag')
Arguments
Description
Method of a target object. 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.
Examples
Get the property name for the parameter Gain in the Simulink block Gain1, incrementally increase gain, and pause to observe signal trace.
id = getparamid(tg, 'Subsyste/Gain1', 'Gain') for i = 1 : 3 set(tg, id, i*2000); pause(1); end
Get the property name (P0, P1, . . .) of a single block.
getparamid(tg, 'Gain1', 'Gain')
Get the property index (0, 1, . . .) of asingal block.
getparamid(tg, 'Gain1', 'Gain', 'numeric')
P5 is a property of the target object. For example, you could assign a value to the gain with tg.p5 = 1000.
See Also
The xPC Target scope object method getsignalid
. The xPC target M-file demo scripts listed in xPC Target Demos.
![]() | getlog | getscope | ![]() |