Specify additional options to use with
FunctionApproximation.Options object contains additional
options for defining a
options = FunctionApproximation.Options()
FunctionApproximation.Options object to use as an input to
FunctionApproximation.Problem object. The output,
options, uses default property values.
options = FunctionApproximation.Options(
FunctionApproximation.Options object with property values
specified by one or more
Name,Value pair arguments.
Name must appear inside single quotes (
You can specify several name-value pair arguments in any order as
AbsTol— Absolute tolerance of difference between original and approximate
Maximum tolerance of the absolute value of the difference between the original output value and the output value of the approximation, specified as a non-negative scalar.
AllowUpdateDiagram— Whether to allow updating of the model diagram during the approximation process
Whether to allow updating of the model diagram during the approximation
process, specified as a logical. This property is only relevant for
FunctionApproximation.Problem objects that specify a
Lookup Table block, or a Math Function
block as the item to approximate.
BreakpointSpecification— Spacing of breakpoint data
Spacing of breakpoint data, specified as one of the following values.
|Lookup table breakpoints are specified explicitly. Breakpoints can be closer together for some input ranges and farther apart in others.|
|Lookup table breakpoints are evenly spaced throughout.|
|Lookup table breakpoints use power-of-two spacing. This breakpoint specification boasts the fastest execution speed because a bit shift can replace the position search.|
For more information on how breakpoint specification can affect performance, see Effects of Spacing on Speed, Error, and Memory Usage.
Display— Whether to display details of each iteration of the optimization
Whether to display details of each iteration of the optimization,
specified as a logical. A value of
1 results in
information in the command window at each iteration of the approximation
process. A value of
0 does not display information until
the approximation is complete.
Interpolation— Method when an input falls between breakpoint values
When an input falls between breakpoint values, the lookup table interpolates the output value using neighboring breakpoints.
|Fits a line between the adjacent breakpoints, and returns the point on that line corresponding to the input.|
|Returns the output value corresponding to the breakpoint value that is immediately less than the input value. If no breakpoint value exists below the input value, it returns the breakpoint value nearest the input value.|
|Returns the value corresponding to the breakpoint that is closest to the input. If the input is equidistant from two adjacent breakpoints, the breakpoint with the higher index is chosen.|
|Generates a Direct Lookup
Table (n-D) block, which performs table
lookups without any interpolation or extrapolation.|
When generating a Direct Lookup Table block, the maximum number of inputs is two.
RelTol— Relative tolerance of difference between original and approximate
Maximum tolerance of the relative difference between the original output value and the output value of the approximation, specified as a non-negative scalar.
SaturateToOutputType— Saturate output of function to approximate to range of output type
Logical value specifying whether to automatically saturate the range of the output of the function to approximate to the range of the output data type.
WordLengths— Word lengths permitted in the lookup table approximate
Specify the word lengths, in bits, that can be used in the lookup table approximate based on your intended hardware. For example, if you intend to target an embedded processor, you can restrict the data types in your lookup table to native types, 8, 16, and 32.
options.WordLengths = [8,16,32];
Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB).
When you set
'ExplicitValues', during the approximation process, the algorithm
also attempts to find a solution using
'EvenPow2Spacing'. Likewise, when you set
the algorithm also attempts to find a solution using
'EvenPow2Spacing'. If you set the property to
'EvenPow2Spacing', the algorithm only attempts to find a solution
using this spacing.
In cases where the
BreakpointSpecification property is set to
'EvenSpacing', but the
InputLowerBounds property of the
FunctionApproximation.Problem object is equal to the range of the
InputTypes, the algorithm does not attempt to find a solution