| Simulink | ![]() |
www.kxcad.net Home > CAE Software Index > MATLAB Index >
| On this page… |
|---|
Sizes of Breakpoint Data Sets and Table Data |
Simulink imposes the following constraints on the sizes of breakpoint data sets and table data associated with lookup table blocks:
Your system's memory limitations constrain the overall size of a lookup table.
Simulink requires correctly dimensioned lookup tables such that the overall size of the table data reflects the size of each breakpoint data set.
To illustrate the second constraint, consider the following vectors of input and output values that create the relationship depicted in the plot:
Vector of input values: [-3 -2 -1 0 1 2 3] Vector of output values: [-3 -1 0 -1 0 1 3]

Here, the input and output data are the same size (1-by-7), making the data consistently dimensioned for a 1-D lookup table.
The following input and output values define the 2-D lookup table that is graphically shown:
Row index input values: [1 2 3] Column index input values: [1 2 3 4] Table data: [11 12 13 14; 21 22 23 24; 31 32 33 34]

In this example, the sizes of the vectors representing the row and column indices are 1-by-3 and 1-by-4, respectively. Consequently, the output table must be of size 3-by-4 for consistent dimensioning.
The first stage of a table lookup operation involves relating inputs to the breakpoint data sets. The search algorithm requires that input breakpoint sets be monotonically increasing, that is, each successive element is equal to or greater than its preceding element. For example, the vector
A = [0 0.5 1 1.9 2 2 2 2.1 3]
repeats the value 2 while all other elements are increasingly larger than their predecessors; hence, A is monotonically increasing.
But for lookup tables populated with data types other than double or single, the search algorithm requires an additional constraint due to quantization effects. In such cases, the input breakpoint data sets must be strictly monotonically increasing, i.e., each successive element must be greater than its preceding element. Consider the vector
B = [0 0.5 1 1.9 2 2.1 2.17 3]
in which each successive element is greater than its preceding element, making B strictly monotonically increasing.
Note that although a breakpoint data set might be strictly monotonic in doubles format, it might not be so after conversion to a fixed-point data type.
You can represent discontinuities in lookup tables that have monotonically increasing breakpoint data sets. To create a discontinuity, simply repeat an input value in the breakpoint data set with different output values in the table data. For example, these vectors of input (x) and output (y) values associated with a 1-D lookup table create the step transitions depicted in the plot that follows:
Vector of input values: [-2 -1 -1 0 0 1 1 2] Vector of output values: [-1 -1 -2 -2 2 2 1 1]

This example has discontinuities at x = -1, 0, and +1.
When there are two output values for a given input value, the block chooses the output according to these rules:
If the input signal is less than zero, the block returns the output value associated with the last occurrence of the input value in the breakpoint data set. In this example, if the input is -1, y is -2, marked with a solid circle.
If the input signal is greater than zero, the block returns the output value associated with the first occurrence of the input value in the breakpoint data set. In this example, if the input is 1, y is 2, marked with a solid circle.
If the input signal is zero and there are two output values specified at the origin, the block returns the average of those output values. In this example, if the input is 0, y is 0, the average of the two output values -2 and 2 specified at x = 0.
When there are three points specified at the origin, the block generates the output associated with the middle point. The following example demonstrates this special rule:
Vector of input values: [-2 -1 -1 0 0 0 1 1 2] Vector of output values: [-1 -1 -2 -2 1 2 2 1 1]

In this example, three points define the discontinuity at the origin. When the input is 0, y is 1, the value of the middle point.
You can apply this same method to create discontinuities in breakpoint data sets associated with multidimensional lookup tables.
| Entering Breakpoints and Table Data | Estimating Missing Points | ![]() |
© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments