Main Content

getBlockParam

Get parameterization of tuned block in slTuner interface

Description

getBlockParam lets you retrieve the current parameterization of a tuned block in an slTuner interface.

An slTuner interface parameterizes each tuned Simulink® block as a Control Design Block, or a generalized parametric model of type genmat or genss. This parameterization specifies the tuned variablesTuned Variables for commands such as systune.

blk_param = getBlockParam(st,blk) returns the parameterization used to tune the Simulink block, blk.

example

[blk_param1,...,blk_paramN] = getBlockParam(st,blk1,...,blkN) returns the parameterizations of one or more specified blocks.

example

S = getBlockParam(st) returns a structure containing the parameterizations of all the tuned blocks of st.

example

Examples

collapse all

Create an slTuner interface for the scdcascade model.

open_system('scdcascade');
st = slTuner('scdcascade',{'C1','C2'});

Examine the block parameterization of one of the tuned blocks.

blk_param = getBlockParam(st,'C1')
Tunable continuous-time PID controller "C1" with formula:

             1 
  Kp + Ki * ---
             s 

and tunable parameters Kp, Ki.

Type "pid(blk_param)" to see the current value.

The block C1 is a PID Controller block. Therefore, its parameterization in st is a tunablePID Control Design Block.

Create an slTuner interface for the scdhelicopter model.

open_system('scdhelicopter')
st = slTuner('scdhelicopter',{'PI1','PI2','PI3','SOF'});

Retrieve the parameterizations for the PI controllers in the model.

[parPI1,parPI2,parPI3] = getBlockParam(st,'PI1','PI2','PI3');

Create an slTuner interface for the scdcascade model.

open_system('scdcascade')
st = slTuner('scdcascade',{'C1','C2'});

Retrieve the parameterizations for both tuned blocks in st.

blockParams = getBlockParam(st)
blockParams = 

  struct with fields:

    C1: [1×1 tunablePID]
    C2: [1×1 tunablePID]

blockParams is a structure with field names corresponding to the names of the tunable blocks in st. The field values of blockParams are tunablePID models, because C1 and C2 are both PID Controller blocks.

Input Arguments

collapse all

Interface for tuning control systems modeled in Simulink, specified as an slTuner interface.

Block in the list of tuned blocks for st, specified as a character vector or string. You can specify the full block path or any portion of the block path that uniquely identifies the block among the other tuned blocks of st.

Example: blk = 'scdcascade/C1', blk = "C1"

Output Arguments

collapse all

Parameterization of the specified tuned block, returned as one of the following:

Parameterization of all tuned blocks in st, returned as a structure. The field names in S are the names of the tuned blocks in st, and the corresponding field values are block parameterizations as described in blk_param.

More About

collapse all

Version History

Introduced in R2011b