How to Write Custom Simulink Data Type Rules in MATLAB

Write custom data type rules as MATLAB functions, and other automatic data type propagation policies
97 descargas
Actualizado 11 Jul 2018

Ver licencia

Simulink models often begin life using purely double-precision data. As the fidelity of the model increases to include specifications of the embedded system it will be deployed on, more floating-point and fixed-point data types are often needed. Manually specifying all these data types for optimal numerical performance and system efficiency while continuing to evolve the design is time consuming and error prone.
Data type automation aims to reduce this cost. You can save time, reduce effort, apply policies, and maintain correctness by adding rules to the model to ensure data types match across signals. Construct signals with the right properties so they produce errors when your rules are violated.

This document explains how you can write your own data type rules as MATLAB functions and integrate them into your Simulink model’s data type propagation process.

Writing your own rule is the highest level of customization and requires the most expertise and resources. There are a few simpler alternatives you should consider first. Simpler out-of-the-box methods may be more compatible with the entire MathWorks tool chain (such as verification and validation products), while highly customized methods may not be completely understood by such tools.

This document describes solutions for automating data type rules in order of increasing complexity. The first section contains simple and widely capable methods. The second contains advanced techniques requiring a greater level of investment.

1. Simple techniques
a. Back-propagation
b. The Data Type Duplicate block
c. The Signal Specification block
2. More sophisticated and custom techniques
a. The Data Type Propagation block
b. Mask-controlled data type rules
c. MATLAB-authored custom data type rules

The licenses required for the demonstration models in this document are Simulink and Fixed-Point Designer. The models were tested with R2018a and may work with some earlier releases as well.

Citar como

Alexander Carmeli (2024). How to Write Custom Simulink Data Type Rules in MATLAB (https://www.mathworks.com/matlabcentral/fileexchange/67888-how-to-write-custom-simulink-data-type-rules-in-matlab), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2018a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0