Class: coder.FixptConfig
Package: coder
Add design range specification to parameter
addDesignRangeSpecification(fcnName,paramName,designMin, designMax)
addDesignRangeSpecification(
specifies
the minimum and maximum values allowed for the parameter, fcnName
,paramName
,designMin
, designMax
)paramName
,
in function, fcnName
. The fixed-point conversion
process uses this design range information to derive ranges for downstream
variables in the code.
% Set up the fixed-point configuration object fixptcfg = coder.config('fixpt'); fixptcfg.TestBenchName = 'dti_test'; fixptcfg.addDesignRangeSpecification('dti', 'u_in', -1.0, 1.0) fixptcfg.ComputeDerivedRanges = true; %Set up C code configuration object cfg = coder.config('lib'); % Derive ranges and generate fixed-point C code codegen -config cfg -float2fixed fixptcfg dti -report