Main Content

coder.descriptor.FixAxisMetadata Class

Namespace: coder.descriptor

Abstract class to get breakpoint set data information

Since R2020b

Description

Abstract base class to get breakpoint set data information. Based on the breakpoint set data, you can get either a coder.descriptor.EvenSpacingMetadata object or a coder.descriptor.NonEvenSpacingMetadata object. To get breakpoint set data information, use the coder.descriptor.BreakpointDataInterface object.

You can get a coder.descriptor.FixAxisMetadata object if the model meets these conditions:

  • Table data is tunable.

    Table data is tunable if the Lookup Table block uses a Simulink.Parameter object that has a non-Auto storage class or the model configuration parameter Default parameter behavior is Tunable.

  • Breakpoint set data is not tunable.

    Breakpoint set data is tunable if the Lookup Table block uses a Simulink.Parameter object that has a non-Auto storage class or the model configuration parameter Default parameter behavior is Tunable.

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.

Input Arguments

expand all

Specify the Parameters data interface type.

Example: Parameters

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 that has a 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 that has these properties:
      EvenSpacingMetadata with properties:
        StartingValue: 2
            StepValue: 2
            NumPoints: 3
               IsPow2: 1

  5. If the breakpoint set data value is changed to [1 5 10], 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