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
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'}
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
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');
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)