addAlgorithmProperty
Add algorithm properties for code replacement table entry
Description
addAlgorithmProperty(
adds algorithm property settings to the conceptual
representation of a code replacement table entry.
For example, use this function to adjust the
algorithms applied by lookup table
functions.hEntry
,Name,Value
)
Examples
Configure Algorithm Properties for lookup1D Function
This example shows how to use the
addAlgorithmProperty
function
to configure the code generator to apply these
methods when replacing code for the
lookup1D
function:
Clip extrapolation
Linear interpolation
Binary or linear index search
hLib = RTW.TflTable; hEnt = RTW.TflCFunctionEntry; hEnt.setTflCFunctionEntryParameters( ... 'Key', 'lookup1D', ... 'Priority', 100, ... 'ImplementationName', 'my_Lookup1D_Repl', ... 'ImplementationHeaderFile', 'my_Lookup1D.h', ... 'ImplementationSourceFile', 'my_Lookup1D.c', ... 'GenCallback', 'RTW.copyFileToBuildDir'); arg = hEnt.getTflArgFromString('y1','double'); arg.IOType = 'RTW_IO_OUTPUT'; hEnt.addConceptualArg(arg); arg = hEnt.getTflArgFromString('u1','double'); hEnt.addConceptualArg(arg); arg = RTW.TflArgMatrix('u2','RTW_IO_INPUT','double'); arg.DimRange = [0 0; Inf Inf]; hEnt.addConceptualArg(arg); arg = RTW.TflArgMatrix('u3', 'RTW_IO_INPUT', 'double'); arg.DimRange = [0 0; Inf Inf]; hEnt.addConceptualArg(arg); hEnt.addAlgorithmProperty('ExtrapMethod', 'Clip'); hEnt.addAlgorithmProperty('InterpMethod', 'Linear point-slope'); hEnt.addAlgorithmProperty('IndexSearchMethod', 'Linear search');
Input Arguments
Version History
Introduced in R2014b