MATLAB Examples

Fixed-Point Graphical Functions

This example shows the use of fixed point operations in Stateflow® to create a graph from a sine wave input.

Notice that in Simulink® the original input is simply a sine wave. A Data Type Conversion block changes this signal to $fixdt(1,16,4)$.

The upper graph is the output from the Stateflow® chart, while the lower graph is a sine wave signal multiplied by -3. The Stateflow® chart multiplies the original sine wave signal by -3 only if the input signal is already negative. This gain causes an output that is always positive.