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
更新 2018/7/11

ライセンスの表示

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.

引用

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. 取得済み .

MATLAB リリースの互換性
作成: R2018a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersStandards, Guidelines, and Block Usage についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0