This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

writeLookupTableData

Update portion of tuned lookup table

When tuning lookup table blocks with systune, use this function to update only a portion of the table data in the Simulink® model. This function is useful when retuning a single point or a portion of the lookup table. To update the entire lookup table, use writeBlockValue.

Syntax

writeLookupTableData(st,blockid,breakpoints)
writeLookupTableData(st,blockid,ix1,…,ixN)

Description

example

writeLookupTableData(st,blockid,breakpoints) writes tuned gain values from an slTuner interface to a portion of a lookup table in the associated Simulink model. Each row of breakpoints identifies an entry in the lookup table to update. blockid must identify a single block in the TunedBlocks property of the slTuner interface.

example

writeLookupTableData(st,blockid,ix1,…,ixN) updates a rectangular portion of the table data. The index vectors ix1,…,ixN select specific breakpoints along each table dimension.

Examples

collapse all

Suppose you have an slTuner interface st to a Simulink model that contains a 2-D Lookup Table block Kp Lookup. The block is listed in slTuner.TunedBlocks. Suppose further that you have retuned for design points corresponding to the (3,5) and (4,6) breakpoints in the lookup table. Update the lookup table with the new values.

breakpoints = [3 5;4 6];
writeLookupTableData(st,'Kp Lookup',breakpoints)

Suppose you have retuned design points between the third and fifth values of the first scheduling variable, and the seventh and tenth values of the second scheduling variables. Update the lookup table with the new values.

ix1 = 3:5;
ix2 = 7:10;
writeLookupTableData(st,'Kp Lookup',ix1,ix2)

Input Arguments

collapse all

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

Lookup table to update with tuned values, specified as a character vector or string. The block identified by blockid must be a lookup-table block in the TunedBlocks property of the slTuner interface st. You can specify a full block path, or any portion of the block path that uniquely identifies the block among the other tuned blocks of st.

Example: 'scdcascade/Kp Lookup'

Example: "Kp Lookup"

Lookup-table entries to update, specified as an integer array. Each row of breakpoints specifies a table entry by its (i1,i2,…,iN) subscripts. For instance:

  • To update the data associated with the first and third breakpoints in a 1-D Lookup Table block, use breakpoints = [1;3].

  • To update the data associated with the (3,5) and (4,6) entries in a 2-D Lookup Table block, use breakpoints = [3 5;4 6].

Portion of lookup table to update, specified as index vectors that select specific breakpoints along each table dimension. For instance, to update a 2-D Lookup Table block, specify two index vectors that identify the rows and columns to update. If you want to update the portion of the table blocked out by entries 3 through 5 in the first dimension and 7 through 10 in the second dimension, use ix1 = 3:5 and ix2 = 7:10.

Tips

  • If you use writeBlockValue to update other retuned blocks in your model, exclude the lookup table blockid from the list of blocks to update with that function.

Introduced in R2017b