Main Content

jc_0651: Implementing a type conversion

Since R2020a

Guideline Publication

Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®

Sub ID Recommendations

  • NA-MAAB — No recommendations

  • JMAAB — a

MATLAB Versions

All

Rule

Sub ID a

The Output data type parameter of the output signal of a numerical operation block shall be set to Inherit:. A Data Type Conversion shall be used when changing the data type of the block output signal.

Custom Parameter

Not Applicable

Example — Correct

The Output data type parameter of the Divide block is set to Inherit: Inherit via internal rule.

Example — Incorrect

The Output data type parameter of the Divide block is set to int16.

Rationale

Sub ID a:

  • Dividing the math operations and type cast can help to clarify the order of execution and data type for each expression.

Verification

Model Advisor check: Check Output data type of operation blocks (Simulink Check)

Last Changed

R2024b

Version History

Introduced in R2020a