Fixed-Point Blockset | ![]() ![]() |
Parameters for fixpt_look1_func_approx
To use the function fixpt_look1_func_approx
, you must first define its parameters. The required parameters for the function are
funcstr
- The ideal function
xmin
- The minimum input of interest
xmax
- The maximum input of interest
xdt
- The x data type
xscale
- The x data scaling
ydt
- The y data type
yscale
- The y data scaling
rndmeth
- The rounding method
In addition there are three optional parameters:
errmax
- The maximum allowed error of the lookup table
nptsmax
- The maximum number of points of the lookup table
spacing
- The allowed spacing between breakpoints
You must use at least one of the parameters errmax
and nptsmax
. The next section Setting Function Parameters for the Lookup Table gives typical settings for these parameters.
Using Only errmax
If you use only the errmax
parameter, without nptsmax
, the function creates a lookup table with the fewest points, for which the worst case error is at most errmax
. See Example 1: Using errmax with Unrestricted Spacing.
Using Only nptsmax
If you use only the nptsmax
parameter without errmax
, the function creates a lookup table with at most nptsmax
points, which has the smallest worse case error. See Example 2: Using nptsmax with Unrestricted Spacing.
The section Specifying Both errmax and nptsmax describes how the function behaves when you specify both errmax
and nptsmax
.
Spacing
You can use the optional spacing
parameter to restrict the spacing between breakpoints of the lookup table. The options are
'unrestricted'
- The default.
'even'
- The distance between any two adjacent breakpoints is the same.
'pow2'
- The distance between any two adjacent breakpoints is the same and the distance is a power of two.
The section Restricting the Spacing and the examples that follow it explain how to use the spacing parameter.
![]() | Creating Lookup Tables for a Sine Function | Setting Function Parameters for the Lookup Table | ![]() |