Hauptinhalt

Simulink.lookuptable.Evenspacing

Configure evenly spaced breakpoint set for lookup table object

Description

A Simulink.lookuptable.Evenspacing object stores evenly spaced breakpoint set information for a lookup table. The object is stored in the Evenspacing property of a Simulink.LookupTable object.

You can use Simulink.LookupTable objects to store and configure a lookup table for ASAP2 and AUTOSAR code generation.

To represent multiple evenly spaced breakpoint sets for a multidimensional lookup table, store a vector of Simulink.lookuptable.Evenspacing objects in the Evenspacing property of a Simulink.LookupTable object.

Creation

When you create a Simulink.LookupTable object and set BreakpointSpecification to "Even spacing", a Simulink.lookuptable.Evenspacing object is created as the value of its Breakpoints property.

To create more Simulink.lookuptable.Evenspacing objects for a Simulink.LookupTable object, use this technique:

  1. Access the Breakpoints property by specifying a vector index.

  2. Set the value of any of the object properties. A Simulink.lookuptable.Evenspacing object is created with the property value you specified and default values for all other properties.

The value of the Breakpoints property is an array of Simulink.lookuptable.Evenspacing objects. Each embedded object represents one evenly spaced breakpoint set.

For example, to create breakpoint sets for a Simulink.LookupTable object myLookupTable, access the Breakpoints property by specifying vector indices and then set the FirstPoint and Spacing properties.

myLookupTable.Breakpoints(1).FirstPoint = -1;
myLookupTable.Breakpoints(1).Spacing = 2;
myLookupTable.Breakpoints(2).FirstPoint = -2;
myLookupTable.Breakpoints(2).Spacing = 1;
myLookupTable.Breakpoints(3).FirstPoint = -5;
myLookupTable.Breakpoints(3).Spacing = 2;

Properties

expand all

Data type of evenly spaced breakpoint set elements, specified as a character vector or string scalar. You can explicitly specify an integer, a floating-point, a fixed-point data type, or a data type expression such as the name of a Simulink.AliasType object.

The default value, "auto", means that the breakpoint set acquires a data type from the value that you specify in the Value property. If you use an untyped expression such as [1 2 3] to set Value, the breakpoint data use the data type double. If you specify a typed expression such as single([1 2 3]) or an fi object, the breakpoint data use the data type specified by the expression or object.

For more information about data types in Simulink®, see Data Types Supported by Simulink. To decide how to control the data types of table and breakpoint data in Simulink.LookupTable and Simulink.Breakpoint objects, see Control Data Types of Lookup Table Objects (Simulink Coder).

Example: "int16"

Example: "myTypeAlias"

Data Types: char | string

Description of the breakpoint set, specified as a character vector or string scalar.

Example: "This breakpoint set represents the pressure input."

Data Types: char | string

First point in evenly spaced breakpoint data, specified as a numeric scalar. To control the data type of the breakpoint set, use the DataType property of the Simulink.lookuptable.Evenspacing object.

When you set DataType to "auto", to set the FirstPoint property, use a typed expression such as single(1) or use the fi (Fixed-Point Designer) constructor to embed a fi object.

Example: -1

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | fi

Name of the Simulink.lookuptable.Evenspacing object that stores the information for the first point, specified as a character vector or string scalar. Generated code uses this name to display the first point.

Example: "myFirstPointName"

Data Types: char | string

Maximum value of the elements of the evenly spaced breakpoint set, specified as a numeric, real value of the data type double.

Example: 17.23

Data Types: double

Minimum value of the elements of the evenly spaced breakpoint set, specified as a numeric, real value of the data type double.

Example: -52.6

Data Types: double

Spacing between points in an evenly spaced breakpoint data set, specified as a numeric scalar. To control the data type of the breakpoint set, use the DataType property of the Simulink.lookuptable.Evenspacing object.

When you set DataType to 'auto', to set the Spacing property, use a typed expression such as single(1) or use the fi (Fixed-Point Designer) constructor to embed an fi object.

Example: 1

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | fi

Name of the Simulink.lookuptable.Evenspacing object that stores the information for the spacing, specified as a character vector or string scalar. Generated code uses this name to display the spacing.

Example: "mySpacing"

Data Types: char | string

Name of a structure field in the generated code, specified as a character vector or string scalar. This field stores the length of the breakpoint set, which the generated code algorithm uses to determine the size of the table. To tune the effective size of the table during code execution, change the value of this structure field in memory.

The code generator uses the property only when the Simulink.lookuptable.Evenspacing object exists in a Simulink.LookupTable object, in which you set BreakpointsSpecification to "Even spacing" and SupportTunableSize to true

Example: "LengthForDim1"

Data Types: char | string

Physical unit of the elements of the evenly spaced breakpoint set, specified as a character vector or string scalar.

Example: "inches"

Data Types: char | string

Version History

Introduced in R2017b