setAlgorithmParameters
Set algorithm parameters for lookup table function code replacement table entry
Description
setAlgorithmParameters(
sets
the algorithm parameters for the lookup table function identified
in the code replacement table entry tableEntry
, algParams
)tableEntry
.
Examples
Set Algorithm Parameters for prelookup
Function Table Entry
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', 'Ifx_DpSearch_u8');
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]
Display the valid values for parameter UseLastBreakpoint
for the
prelookup
function.
algParams.UseLastBreakpoint
ans = UseLastBreakpoint with properties: Name: 'UseLastBreakpoint' Options: {'off' 'on'} Primary: 0 Value: {'off' 'on'}
Display the valid values for parameter RemoveProtectionInput
for
the prelookup
function.
algParams.RemoveProtectionInput
ans = RemoveProtectionInput with properties: Name: 'RemoveProtectionInput' Options: {'off' 'on'} Primary: 0 Value: {'off' 'on'}
Set parameters UseLastBreakpoint
and
RemoveProtectionInput
to on
and
off
, respectively.
algParams.UseLastBreakpoint = 'on'; algParams.RemoveProtectionInput = 'off';
When you set each parameter, the algorithm parameter software checks for and reports errors for invalid syntax, parameter names, and values.
Update the parameter settings for the code replacement table entry.
setAlgorithmParameters(tableEntry, algParams);
Get the new algorithm parameter settings for the prelookup
function
table entry.
algParams = getAlgorithmParameters(tableEntry);
Examine the new value for UseLastBreakpoint
.
algParams.UseLastBreakpoint
ans = UseLastBreakpoint with properties: Name: 'UseLastBreakpoint' Options: {'off' 'on'} Primary: 0 Value: {'on'}
Examine the new value for RemoveProtectionInput
.
algParams.RemoveProtectionInput
ans = RemoveProtectionInput with properties: Name: 'RemoveProtectionInput' Options: {'off' 'on'} Primary: 0 Value: {'off'}
Set Algorithm Parameters for lookup2D
Function Table Entry
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 valid values for algorithm parameter IndexSearchMethod
for
the lookup2D
function.
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'}
Set parameter IndexSearchMethod
to Evenly spaced
points
.
algParams.IndexSearchMethod = 'Evenly spaced point';
Error using coder.algorithm.parameter.validateValue (line 58) Invalid value '{Evenly spaced point}' for algorithm parameter 'coder.algorithm.parameter.IndexSearchMethod'. Valid values are '{Linear search, Binary search, Evenly spaced points}'. Error in coder.algorithm.parameter.AlgorithmParameter/set.Value (line 49) obj.Value = coder.algorithm.parameter.validateValue(obj, val); Error in coder.algorithm.parameter.AlgorithmParameter/setAP (line 36) obj.Value = value; Error in coder.algorithm.parameterset.Lookup/set.IndexSearchMethod (line 39) obj.IndexSearchMethod = obj.IndexSearchMethod.setAP(value);
The code replacement software flags the ‘s
’ that is missing from
‘points
’.
Adjust the parameter setting.
algParams.IndexSearchMethod = 'Evenly spaced points';
Update the parameter settings for the code replacement table entry.
setAlgorithmParameters(tableEntry, algParams);
Get the updated algorithm parameter settings for the lookup2D
function
table entry.
algParams = getAlgorithmParameters(tableEntry);
Verify the new value of IndexSearchMethod
.
algParams.IndexSearchMethod
ans = IndexSearchMethod with properties: Name: 'IndexSearchMethod' Options: {'Linear search' 'Binary search' 'Evenly spaced points'} Primary: 0 Value: {'Evenly spaced points'}
Input Arguments
tableEntry
— Code replacement table entry for a lookup table function
object
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 setAlgorithmParameters
.
Create the entry. For example, call the function
RTW.TflCFunctionEntry
.tableEntry = RTW.TflCFunctionEntry;
Specify the name of the lookup table function for which you created the entry. Use the
Key
parameter in a call tosetTflCFunctionEntryParameters
. The following function call specifies the lookup table functionprelookup
.setTflCFunctionEntryParameters(tableEntry, ... 'Key', 'prelookup', ... 'Priority', 100, ... 'ImplementationName', 'Ifx_DpSearch_u8');
algParams
— Algorithm parameter settings for a lookup table function
object
Algorithm parameter settings for the lookup table function identified
with the Key
parameter in tableEntry
.
Version History
Introduced in R2015a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)