Main Content

coder.descriptor.NonEvenSpacingMetadata Class

Namespace: coder.descriptor
Superclasses: coder.descriptor.FixAxisMetadata

Return information about non-evenly spaced breakpoint set data

Since R2020b

Description

The coder.descriptor.NonEvenSpacingMetadata object describes the points in breakpoint set data that are non-evenly spaced.

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 further contains a coder.descriptor.NonEvenSpacingMetadata object if the breakpoint set data is non-evenly spaced.

Input Arguments

expand all

Specify the Parameters data interface type.

Example: Parameters

Properties

expand all

All values that are in the non-evenly spaced breakpoint set data.

Attributes:

GetAccess
public

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 an n-D Lookup Table. The n-D Lookup Table block takes table data from a model workspace variable named tableData that has a value of [4 5 6]. The tableData is a Simulink.Parameter object with a non-Auto storage class. The breakpoint set data is specified as [1 5 10].

n-D Loop Table Block Parameters dialog box that shows tableData variable specified as Table data and Breakpoint data set as 1, 5, 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 gives you 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.NonEvenSpacingMetadata object that has these properties:
      NonEvenSpacingMetadata with properties:
        AllPoints: [1×3 Real Sequence]

Version History

Introduced in R2020b