Main Content

coder.descriptor.EvenSpacingMetadata class

Package: coder.descriptor
Superclasses: coder.descriptor.FixAxisMetadata

Return information about evenly spaced breakpoint set data

Description

The coder.descriptor.EvenSpacingMetadata object describes breakpoint set data that is evenly spaced, such as starting point, breakpoint step size, and number of points.

Creation

params = getDataInterfaces(codeDescObj, dataInterfaceName) creates a coder.descriptor.BreakpointDataInterface object for each dimension in the lookup table. The codeDescObj object is the coder.codedescriptor.CodeDescriptor object created for the model by using the getCodeDescriptor function.

The coder.descriptor.BreakpointDataInterface object has property FixAxisMetadata that contains a coder.descriptor.FixAxisMetadata object. The coder.descriptor.FixAxisMetadata contains a coder.descriptor.EvenSpacingMetadata object if the breakpoint set data is evenly spaced.

Input Arguments

expand all

Specify the Parameters data interface type.

Example: Parameters

Properties

expand all

The first point in evenly spaced breakpoint set data.

The spacing between points in evenly spaced breakpoint set data. This value represents a power of 2 if the IsPow2 returns 1.

Total number of points in evenly spaced breakpoint set data.

Returns 1 if the value in StepValue is a power of 2.

Data Types: logical

Examples

collapse all

Consider creating model codeDescDemo or a model with similar specifications.

Model that contains a n-D Lookup Table connected between an Inport and an Outport.

The model contains a n-D Lookup Table. The n-D Lookup Table block takes table data from a model workspace variable named tableData with value [4 5 6]. The tableData is a Simulink.Parameter object with non-Auto storage class. The breakpoint set data is specified as [2 6 10].

n-D Loop Table Block Parameters dialog box that shows tableData variable specified as Table data and Breakpoint data set as 2, 6, and 10.

The model configuration parameter Default parameter behavior is set to Inlined.

  1. Build the model and create a coder.codedescriptor.CodeDescriptor object for the model.

    codeDescObj = coder.getCodeDescriptor('codeDescDemo')

  2. Retrieve properties of the Lookup Table block and breakpoint set in the generated code.

    params = getDataInterfaces(codeDescObj, 'Parameters')
    The params variable is an array of coder.descriptor.LookupTableDataInterface and coder.descriptor.BreakpointDataInterface objects.
      LookupTableDataInterface with properties:
                           Type: [1×1 coder.descriptor.types.Type]
                            SID: 'demoModel:22'
                  GraphicalName: 'tableData'
                    VariantInfo: [1×0 coder.descriptor.VariantInfo]
                 Implementation: [1×1 coder.descriptor.DataImplementation]
                         Timing: [1×0 coder.descriptor.TimingInterface]
                           Unit: ''
                          Range: [1×1 coder.descriptor.Range]
             SupportTunableSize: 0
        BreakpointSpecification: 'Even spacing'
                         Output: [1×1 coder.descriptor.DataInterface]
                    Breakpoints: [1×1 coder.descriptor.BreakpointDataInterface Sequence]

  3. The Breakpoints property of the coder.descriptor.LookupTableDataInterface object holds a vector of coder.descriptor.BreakpointDataInterface objects. Obtain the details of the breakpoint set attached to the Lookup Table block by accessing the first location in the array.

    params.Breakpoints(1)
      BreakpointDataInterface with properties:
                      Type: [1×1 coder.descriptor.types.Type]
                       SID: 'demoModel:22'
             GraphicalName: 'n-D Lookup↵Table'
               VariantInfo: [1×0 coder.descriptor.VariantInfo]
            Implementation: [1×0 coder.descriptor.DataImplementation]
                    Timing: [1×0 coder.descriptor.TimingInterface]
                      Unit: ''
                     Range: [1×1 coder.descriptor.Range]
            OperatingPoint: [1×1 coder.descriptor.DataInterface]
        SupportTunableSize: 0
           FixAxisMetadata: [1×1 coder.descriptor.FixAxisMetadata]

  4. The new coder.descriptor.FixAxisMetadata object provides more information about whether the breakpoint set data is evenly spaced or not.

    params.Breakpoints(1).FixAxisMetadata
    The information is returned as a new coder.descriptor.EvenSpacingMetadata object with these properties:
      EvenSpacingMetadata with properties:
        StartingValue: 2
            StepValue: 2
            NumPoints: 3
               IsPow2: 1

Introduced in R2020b