| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
y = fixpt_interp1(xdata,ydata,x,xdt,xscale,ydt,yscale,rndmeth)
y = fixpt_interp1(xdata,ydata,x,xdt,xscale,ydt,yscale,rndmeth) implements a one-dimensional lookup table to find output y for input x. If x falls between two xdata values (breakpoints), y is the result of interpolating between the corresponding ydata values. If x is greater than the maximum value in xdata, y is the maximum ydata value. If x is less than the minimum value in xdata, y is the minimum ydata value.
If the input data type xdt or the output data type ydt is floating point, fixpt_interp1 performs the interpolation using floating-point calculations. Otherwise, fixpt_interp1 uses integer-only calculations. These calculations handle the input scaling xscale and the output scaling yscale and obey the rounding method rndmeth.
xdata |
Vector of breakpoints for the lookup table, such as linspace(0,8,33). | ||||||||
ydata |
Vector of table data that correspond to the breakpoints for the lookup table, such as sin(xdata). | ||||||||
x |
Vector of input values for the lookup table to process, such as linspace(-1,9,201). | ||||||||
xdt |
Data type of input x, such as sfix(8). | ||||||||
xscale |
Scaling for input x, such as 2^-3. | ||||||||
ydt |
Data type of output y, such as sfix(16). | ||||||||
yscale |
Scaling for output y, such as 2^-14. | ||||||||
rndmeth |
Rounding mode supported by fixed-point Simulink blocks:
|
Interpolate outputs for x using a 1-D lookup table that approximates the sine function:
xdata = linspace(0,8,33).'; ydata = sin(xdata); % Define input x as a vector of 201 evenly % spaced points between -1 and 9 (includes % values both lower and higher than the range % of breakpoints in xdata) x = linspace(-1,9,201).'; % Interpolate output values for x y = fixpt_interp1(xdata,ydata,x,sfix(8),2^-3,sfix(16),... 2^-14,'Floor')
fixpt_evenspace_cleanup | fixpt_look1_func_approx | fixpt_look1_func_plot
![]() | fixpt_evenspace_cleanup | fixpt_look1_func_approx | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |