Simulink Reference Previous page   Next Page
num2fixpt

Quantize a value using a Simulink Fixed Point representation

Syntax

Description

num2fixpt(OrigValue,FixPtDataType,FixPtScaling, RndMeth, DoSatur) casts a real-world value represented in floating-point doubles, OrigValue, as a fixed-point number, outValue.

OrigValue
Identifies the real-world value to be cast to a fixed-point value.
FixPtDataType
Designates the desired fixed-point data type of outValue.
FixPtScaling
Indicates the scaling of the output in either Slope or [Slope Bias] format.
RndMeth
Specifies the rounding technique to be used on the output. If FixPtDataType is FLOAT, then RndMeth is ignored.
DoSatur
Indicates whether the output should be saturated to the minimum or maximum representable value upon underflow or overflow. If FixPtDataType is FLOAT, then DoSatur is ignored.

Examples

The command

returns Pi as a signed 8-bit fixed-point number with scaling of 2^-5. Rounding is toward the nearest representable value, and overflows saturate.

See Also
fixptbestexp, fixptbestprec


Previous page  fxptdlg sfix Next page

© 1994-2005 The MathWorks, Inc.