| Simulink® | ![]() |
y = fixpt_interp1(xdata,ydata,x,xdt,xscale,ydt,yscale,rndmeth)
fixpt_interp1(xdata,ydata,x,xdt,xscale,ydt,yscale,rndmeth) implements a lookup table to find output(s) y for input(s) x. If x falls between two xdata values, then y is found by interpolating between the corresponding ydata pair. If x falls above the range given by xdata, y is given as the maximum ydata value. If x falls below the range given by xdata, y is given as the minimum ydata value.
If either the input data type, xdt, or the output data type, ydt, is floating point, then floating-point calculation is used to perform the interpolation. Otherwise, integer-only calculation is used. This calculation handles the input scaling, xscale, and the output scaling, yscale, appropriately, and obeys the designated rounding method, rndmeth.
Define xdata as a vector of 33 evenly spaced points between 0 and 8, and ydata as the sinc of xdata.
xdata = linspace(0,8,33).'; ydata = sinc(xdata);
Now define your input x as a vector of 201 evenly spaced points between -1 and 9.
x = linspace(-1,9,201).';
Notice that x includes some values that are both lower and higher than the range of xdata.
You can now use fixpt_interp1 to interpolate outputs for x.
y = fixpt_interp1(xdata,ydata,x,sfix(8),2^-3,sfix(16),... 2^-14,'Floor')
fixpt_look1_func_approx, fixpt_look1_func_plot
![]() | fixpt_evenspace_cleanup | fixpt_look1_func_approx | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |