Documentation

Simulink.lookuptable.Evenspacing class

Package: Simulink.lookuptable
Superclasses:

Configure even spacing set data for lookup table object

Description

An object of the Simulink.lookuptable.Evenspacing class stores event spacing set information for a lookup table. The object resides 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 breakpoint sets for a multidimensional lookup table, store a vector of Simulink.lookuptable.Evenspacing objects in the Evenspacing property of a Simulink.LookupTable object.

Construction

When you create a Simulink.LookupTable object and set BreakpointSpecification to 'Even spacing', a Simulink.lookuptable.Evenspacing object appears as the value of the Breakpoints property.

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

Access the Breakpoints property by specifying a vector index.

To create a Simulink.lookuptable.Evenspacing object, you can set the value of any of the object properties. The Simulink.LookupTable object creates the Simulink.lookuptable.Evenspacing object with default property values, and sets the property that you specified.

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

For example, suppose that you create a Simulink.LookupTable object named myLUTObj. To create more breakpoint sets, access the Breakpoints property by specifying scalar indices for FirstPoint and Spacing properties. To create more even spacing breakpoint sets, update the object with this pair of properties:

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

The object myLUTObj creates additional Simulink.lookuptable.Evenspacing objects and sets the FirstPoint and Spacing properties of each object. LUTObj now stores information for three breakpoint sets.

Properties

expand all

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 constructor to embed a fi object.

Example: -1

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

Spacing between points 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 Spacing property, use a typed expression such as single(1) or use the fi constructor to embed an fi object.

Example: -1

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

Data type of breakpoint set elements, specified as a character vector. 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

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

Example: -52.6

Data Types: double

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

Example: 17.23

Data Types: double

Physical unit of the elements of the breakpoint set, specified as a character vector.

Example: 'inches'

Data Types: char

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

Example: 'myFirstPointName'

Data Types: char

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

Example: 'mySpacing'

Data Types: char

Name of a structure field in the generated code, specified as a character vector. 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 under these circumstances, which enable a tunable table size in the generated code:

  • 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

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

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

Data Types: char

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB).

Introduced in R2017b

Was this topic helpful?