Products & Services Industries Academia Support User Community Company

Learn more about xPC Target   

getparamid - Parameter index from parameter list

Syntax

MATLAB command line

getparamid(target_object, 'block_name', 'parameter_name')

Arguments

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.

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.

Troubleshooting chapter question Why Does the getparamid Function Return Nothing?.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS