Iterative Festkomma-Konvertierung in Simulink
Das Fixed-Point Tool automatisiert die Aufgabe der Datentypkonvertierung in einem Simulink®-Modell. Das Tool erfasst Bereichsdaten für Modellobjekte auf Basis der Simulationsbereiche, Entwurfsbereiche oder abgeleiteten Bereiche. Im Workflow Iterative Fixed-Point Conversion schlägt das Tool daraufhin Festkomma-Datentypen vor, die den Bereich mit maximaler Präzision abdecken. Daraufhin können Sie die Datentyp-Vorschläge überprüfen und diese selektiv auf Objekte in Ihrem Modell anwenden. Werden die Entwurfsanforderungen nicht erfüllt, können Sie die Datentyp-Vorschlagseinstellungen anpassen, deren Auswirkungen visualisieren und den Prozess iterieren, bis das System Ihren Anforderungen entspricht.
Um Datentypen in Ihrem Modell in Festkommazahlen umzuwandeln, befolgen Sie die Schritte unter Iterative Fixed-Point Conversion Using the Fixed-Point Tool. Ein Beispiel für den vollständigen Konvertierungsprozess finden Sie unter Convert Floating-Point Model to Fixed Point.
Das Objekt DataTypeWorkflow.Converter und dessen Objektfunktionen sind eine Befehlszeilen-Alternative zu Iterative Fixed-Point Conversion im Fixed-Point Tool.
Tools
| Fixed-Point Tool | Convert a floating-point model to a fixed-point model |
Funktionen
fxptdlg | Open the Fixed-Point Tool |
getUnsupportedFunctionsForSystem | List unsupported functions used by MATLAB Function blocks in the system under design (Seit R2025a) |
Klassen
DataTypeWorkflow.Converter | Create fixed-point converter object |
DataTypeWorkflow.findDecoupledSubsystems | Get a list of subsystems to replace with an approximation |
DataTypeWorkflow.ProposalSettings | Proposal settings object for data type proposals |
DataTypeWorkflow.FunctionReplacement | Object to store function replacements (Seit R2025a) |
DataTypeWorkflow.Result | Object containing run result information |
DataTypeWorkflow.VerificationResult | Verification results after converting a system to fixed point |
Themen
Überblick über den Workflow bei der iterativen Festkomma-Konvertierung
- Data Type Conversion Overview
Convert data types in your model to fixed point in one of three ways. - Best Practices for Fixed-Point Conversion Workflow
Use best practices when converting a model to fixed point. - Iterative Fixed-Point Conversion Using the Fixed-Point Tool
Use the Fixed-Point Tool to convert a system from floating point to fixed point.
- SCHRITT 1: Prepare System for Conversion
- SCHRITT 2: Collect Ranges
- SCHRITT 3: Convert Data Types
- SCHRITT 4: Verify New Settings
- SCHRITT 5: Explore Additional Data Types
- Convert Floating-Point Model to Fixed Point
Use the Fixed-Point Tool to convert a floating-point model to fixed point. - The Command-Line Interface for the Fixed-Point Tool
Learn the differences between the command-line interface workflow and the Fixed-Point Tool workflow.
Vorbereiten des Systems auf die Konvertierung
- Use the Fixed-Point Tool to Prepare a System for Conversion
Use the Fixed-Point Tool to check the system under design for compatibility with the conversion process. - Specify Behavioral Constraints
Use signal tolerances and model verification blocks to verify behavior of fixed-point implementation.
Erfassen der Bereiche
- Fixed-Point Instrumentation and Data Type Override
Fixed-point instrumentation and data type override settings for gathering range information on your model. - Choosing a Range Collection Method
Choose from three methods for collecting ranges on which to base data type proposals. - How Range Analysis Works
Learn how the static analysis derives range information.
- Prevent the Fixed-Point Tool from Overriding Integer Data Types
Maintain integer data types in your model when using data type override.
Vorschlagen von Datentypen
- How the Fixed-Point Tool Proposes Data Types
Learn how the Fixed-Point Tool proposes data types based on collected ranges and proposal settings. - Propose Data Types for Merged Simulation Ranges
Use the Fixed-Point Tool to merge results from multiple simulations, and propose data types based on the merged results. - How Hardware Implementation Settings Affect Data Type Proposals
Use the Fixed-Point Tool to propose word lengths for a model that implements a simple moving average algorithm.
Konvertieren von Datentypen
- Convert a Referenced Model to Fixed Point
Use the Fixed-Point Tool to log simulation minimum and maximum values for referenced models and propose data types based on a union of the collected ranges. - Bus Objects in the Fixed-Point Workflow
Learn how data type override behaves with bus objects, and how data types are determined for bus objects. - Autoscaling Data Objects Using the Fixed-Point Tool
Use the Fixed-Point Tool to convert a model that uses data objects for data type specification to fixed point. - Convert MATLAB Function Block to Fixed Point
Use the Fixed-Point Tool to convert a MATLAB® Function block to fixed-point.
Verifizieren der Ergebnisse
- Control Views in the Fixed-Point Tool
Information filtering, sorting, and analysis in the Fixed-Point Tool. - View Simulation Results
Use the Simulation Data Inspector to view simulation results and compare runs to verify your fixed-point design. - Explore Multiple Floating-Point to Fixed-Point Conversions
Iteratively explore different proposal settings to find the best floating point to fixed-point conversion. - Model Multiple Data Type Behaviors Using a Data Dictionary
Example showing how to use referenced data dictionaries to store multiple sets of data types for a model.
Fehlersuche
Blocks That Do Not Support Fixed-Point Data Types
Troubleshoot blocks that are not supported for fixed-point conversion.
Follow best practices and avoid unsupported MATLAB Function block features.
Best Practices for Working with Stateflow Charts in Automated Fixed-Point Conversion Workflows
Follow best practices for Stateflow® charts to avoid unexpected results.
Models That Might Cause Data Type Propagation Errors
Know which modeling practices could cause data type propagation errors after autoscaling.
Troubleshoot range analysis issues.
Avoid specifying conflicting design minimum and maximum values in your model.
Insufficient Design Range Information
Troubleshoot errors caused by insufficient design range information by providing additional input design minimum and maximum values.
Provide More Design Range Information
Troubleshoot insufficient design range information that prevents successful derived range analysis.
Troubleshoot Range Analysis of System Objects
Reconfigure a System object™, if necessary, so that ranges can be derived for the model.
The Fixed-Point Tool Did Not Propose Data Types
Troubleshoot when the Fixed-Point Tool does not propose data types.
Data Type Mismatch and Structure Initial Conditions
Example showing how to replace a structure initial condition with a
Simulink.Parameter object.
Data Type Propagation Errors After Applying Proposed Data Types
Troubleshoot when the Fixed-Point Tool proposes data types that are not compatible with the model.




