| xPC Target™ | ![]() |
MATLAB® command line
getparamid(target_object, 'block_name', 'parameter_name')
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. |
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.
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
The xPC Target™ scope object method getsignalid.
The xPC Target M-file demo scripts listed in xPC Target™ Demos.
Troubleshooting chapter question Why Does the getparamid Function Return Nothing?.
![]() | getparam | getparamname | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |