Fixed-Point Blockset | ![]() ![]() |
Setting Function Parameters for the Lookup Table
To do the examples in this section, you must first set parameter values for the fixpt_look1_func_approx
function. To do so, type the following at the MATLAB prompt:
funcstr = 'sin(2*pi*x)'; %Define the sine function xmin = 0; %Set the minimum input of interest xmax = 0.25; %Set the maximum input of interestxdt = ufix(16); %Set the x data type
xscale = 2^-16; %Set the x data scaling
ydt = sfix(16); %Set the y data type
yscale = 2^-14; %Set the y data scaling
rndmeth = 'Floor'; %Set the rounding method
errmax = 2^-10; %Set the maximum allowed error nptsmax = 21; %Specify the maximum number of points
If you exit MATLAB after typing these commands, you must retype them before trying any of the other examples in this section.
![]() | Parameters for fixpt_look1_func_approx | Example 1: Using errmax with Unrestricted Spacing | ![]() |