Fixed-Point Blockset | ![]() ![]() |
Additional Features and Capabilities
In addition to the features described in Configuring Fixed-Point Blocks, the Fixed-Point Blockset provides you with these features and capabilities:
Automatic Scaling
You can use the autofixexp
script to automatically change the scaling for each block that has generalized fixed-point output and does not have its scaling locked. The script uses the maximum and minimum values logged during the last simulation run. The scaling is changed such that the simulation range is covered and the precision is maximized.
As an alternative to (and extension of) the automatic scaling script, you can use the Fixed-Point Settings interface. This tool allows you to easily control the parameters associated with automatic scaling and display the simulation results for a given model. To learn how to use the Fixed-Point Settings interface, refer to Tutorial: Feedback Controller Simulation.
Code Generation
With Real-Time Workshop®, the Fixed-Point Blockset can generate C code. The code generated from fixed-point blocks uses only integer types and automatically includes all operations, such as shifts, needed to account for differences in fixed-point locations.
You can use the generated code on embedded fixed-point processors or rapid prototyping systems even if they contain a floating-point processor. The code is structured so that key operations can be readily replaced by optimized target-specific libraries that you supply. You can also use Target Language CompilerTM to customize the generated code. Refer to Code Generation for more information about code generation using fixed-point blocks.
![]() | Configuring Fixed-Point Blocks | Example: Converting from Doubles to Fixed-Point | ![]() |