Main Content

addBlock

Add block to list of tuned blocks forslTunerinterface

Description

example

addBlock(st,blk)adds the block referenced byblkto the list oftuned blocksof theslTunerinterface,st.

Examples

collapse all

Open the Simulink model.

mdl ='scdcascade'; open_system(mdl)

Create anslTunerinterface for the Simulink model, and add a block to the list of tuned blocks of the interface.

st = slTuner(mdl,“C1”); addBlock(st,'C2');

Input Arguments

collapse all

Interface for tuning control systems modeled in Simulink, specified as anslTunerinterface.

Block to add to the list oftuned blocksforst, specified as:

  • Character vector or string — Block path. You can specify the full block path or a partial path. The partial path must match the end of the full block path and unambiguously identify the block to add. For example, you can refer to a block by its name, provided the block name appears only once in the Simulink model.

    For example,blk = 'scdcascade/C1'.

  • Cell array of character vectors or string array — Multiple block paths.

    For example,blk = {'scdcascade/C1','scdcascade/C2'}.

More About

collapse all

Tuned Block

Tuned blocks, used by theslTunerinterface, identify blocks in a Simulink model whose parameters are to be tuned to satisfy tuning goals. You can tune most Simulink blocks that represent linear elements such as gains, transfer functions, or state-space models. (For the complete list of blocks that support tuning, seeHow Tuned Simulink Blocks Are Parameterized). You can also tune more complex blocks such as SubSystem or S-Function blocks by specifying an equivalenttunable linear model.

Use tuning commands such assystuneto tune the parameters of tuned blocks.

You must specify tuned blocks (for example,C1andC2) when you create anslTunerinterface.

st = slTuner('scdcascade',{“C1”,'C2'})

You can modify the list of tuned blocks usingaddBlockandremoveBlock.

To interact with the tuned blocks use:

他的版本tory

Introduced in R2014a