Main Content

getAlgorithmParameters

Examine algorithm parameter settings for lookup table function code replacement table entry

Description

example

algParams = getAlgorithmParameters(tableEntry) returns the algorithm parameter settings for the lookup table function identified in the code replacement table entry tableEntry. If you call getAlgorithmParameters before using setAlgorithmParameters, getAlgorithmParameters lists the default parameter settings for the lookup table function.

Examples

collapse all

Create a code replacement table.

crTable = RTW.TflTable;

Create a table entry for a function.

tableEntry = RTW.TflCFunctionEntry;

Identify the table entry as an entry for the prelookup function.

setTflCFunctionEntryParameters(tableEntry, ...
    'Key', 'prelookup', ...
    'Priority', 100, ...
    'ImplementationName', 'myPrelookup');

Get the algorithm parameter settings for the prelookup function table entry.

algParams = getAlgorithmParameters(tableEntry)
algParams = 

  Prelookup with properties:

             ExtrapMethod: [1x1 coder.algorithm.parameter.ExtrapMethod]
                  RndMeth: [1x1 coder.algorithm.parameter.RndMeth]
        IndexSearchMethod: [1x1 coder.algorithm.parameter.IndexSearchMethod]
        UseLastBreakpoint: [1x1 coder.algorithm.parameter.UseLastBreakpoint]
    RemoveProtectionInput: [1x1 coder.algorithm.parameter.RemoveProtectionInput]

Examine the information for parameter ExtrapMethod.

algParams.ExtrapMethod
ans = 

  ExtrapMethod with properties:

       Name: 'ExtrapMethod'
    Options: {'Linear'  'Clip'}
    Primary: 1
      Value: {'Linear'}

Examine the information for parameter RndMeth.

algParams.RndMeth
ans = 

  RndMeth with properties:

       Name: 'RndMeth'
    Options: {1x7 cell}
    Primary: 0
      Value: {1x7 cell}

Examine the current Value setting.

algParams.RndMeth.Value
ans = 

  Columns 1 through 6

    'Ceiling'    'Convergent'    'Floor'    'Nearest'    'Round'    'Simplest'

  Column 7

    'Zero'

Examine the information for parameter IndexSearchMethod.

algParams.IndexSearchMethod
ans = 

  IndexSearchMethod with properties:

       Name: 'IndexSearchMethod'
    Options: {'Linear search'  'Binary search'  'Evenly spaced points'}
    Primary: 0
      Value: {'Binary search'  'Evenly spaced points'  'Linear search'}

Examine the information for parameter UseLastBreakpoint.

algParams.UseLastBreakpoint
ans = 

  UseLastBreakpoint with properties:

       Name: 'UseLastBreakpoint'
    Options: {'off'  'on'}
    Primary: 0
      Value: {'off'  'on'}

Examine the information for parameter RemoveProtectionInput.

algParams.RemoveProtectionInput
ans = 

  RemoveProtectionInput with properties:

       Name: 'RemoveProtectionInput'
    Options: {'off'  'on'}
    Primary: 0
      Value: {'off'  'on'}

Create a code replacement table.

crTable = RTW.TflTable;

Create a table entry for a function.

tableEntry = RTW.TflCFunctionEntry;

Identify the table entry as an entry for the lookup2D function.

setTflCFunctionEntryParameters(tableEntry, ...
    'Key', 'lookup2D', ...
    'Priority', 100, ...
    'ImplementationName', 'myLookup2D');

Get the algorithm parameter settings for the lookup2D function table entry.

algParams = getAlgorithmParameters(tableEntry)
algParams = 

  Lookup with properties:

                                InterpMethod: [1×1 coder.algorithm.parameter.InterpMethod]
                                ExtrapMethod: [1×1 coder.algorithm.parameter.ExtrapMethod]
                        UseRowMajorAlgorithm: [1×1 coder.algorithm.parameter.UseRowMajorAlgorithm]
                                     RndMeth: [1×1 coder.algorithm.parameter.RndMeth]
                           IndexSearchMethod: [1×1 coder.algorithm.parameter.IndexSearchMethod]
                           UseLastTableValue: [1×1 coder.algorithm.parameter.UseLastTableValue]
    ApplyFullPrecisionForLinearInterpolation: [1×1 coder.algorithm.parameter.ApplyFullPrecisionForLinearInterpolation]
                       RemoveProtectionInput: [1×1 coder.algorithm.parameter.RemoveProtectionInput]
                   SaturateOnIntegerOverflow: [1×1 coder.algorithm.parameter.SaturateOnIntegerOverflow]
                     SupportTunableTableSize: [1×1 coder.algorithm.parameter.SupportTunableTableSize]
                             BPPower2Spacing: [1×1 coder.algorithm.parameter.BPPower2Spacing]
    BeginIndexSearchUsingPreviousIndexResult: [1×1 coder.algorithm.parameter.BeginIndexSearchUsingPreviousIndexResult]

Display the possible index search method settings.

algParams.IndexSearchMethod.Options
ans = 

    'Linear search'    'Binary search'    'Evenly spaced points'

Display the current index search method setting.

algParams.IndexSearchMethod.Value
ans = 

    'Linear search'    'Binary search'    'Evenly spaced points'

By default, the parameter is set to the same value set.

Set the index search method to binary search.

algParams.IndexSearchMethod = 'Binary search';

Verify the modified parameter setting.

algParams.IndexSearchMethod.Value
ans = 

    'Binary search'

Input Arguments

collapse all

Code replacement table entry that you previously created and represents a potential code replacement for a lookup table function. The entry must identify the lookup table function for which you are calling getAlgorithmParameters.

  1. Create the entry. For example, call the function RTW.TflCFunctionEntry.

    tableEntry = RTW.TflCFunctionEntry;

  2. Specify the name of the lookup table function for which you created the entry. Use the Key parameter in a call to setTflCFunctionEntryParameters. The following function call specifies the lookup table function prelookup.

    setTflCFunctionEntryParameters(tableEntry, ...
       'Key', 'prelookup', ...
       'Priority', 100, ...
       'ImplementationName', 'myPrelookup'); 

Output Arguments

collapse all

Algorithm parameter settings for the lookup table function identified with the Key parameter in tableEntry.

Version History

Introduced in R2015a