Main Content


Class: coder.FixPtConfig
Namespace: coder

Replace floating-point function with lookup table during fixed-point conversion




addApproximation(approximationObject) specifies a lookup table replacement in a coder.FixPtConfig object. During floating-point to fixed-point conversion, the conversion process generates a lookup table approximation for the function specified in the approximationObject.

Input Arguments

expand all

Function replacement configuration object that specifies how to create an approximation for a MATLAB® function. Use the coder.FixPtConfig configuration object addApproximation method to associate this configuration object with a coder.FixPtConfig object. Then use the fiaccel function -float2fixed option with coder.FixPtConfig to convert floating-point MATLAB code to fixed-point MATLAB code.


expand all

Create a function replacement configuration object that specifies to replace the log function with an optimized lookup table.

logAppx = coder.approximation('Function','log','OptimizeLUTSize',...

Create a fixed-point configuration object and associate the function replacement configuration object with it.

fixptcfg = coder.config('fixpt');

You can now generate fixed-point code using the fiaccel function.