jc_0803: Passing values to library functions
Since R2020a
Guideline Publication
Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®
Sub ID Recommendations
NA-MAAB — a1/a2, b1/b2, c1/c2,
JMAAB — a1/a2, b1/b2, c1/c2, d1/d2
MATLAB Versions
All
Rule
Sub ID a1
A minimum value for the signed integer type shall not be provided when using the
abs
library function.
Not Applicable
Sub ID a2
The abs
library function shall not be used.
Not Applicable
Sub ID b1
A negative number shall not be entered when using the sqrt
library function.
Not Applicable
Sub ID b2
The sqrt
library function shall not be used.
Not Applicable
Sub ID c1
A negative number shall not be entered when using the log
and
log10
library functions.
Not Applicable
Sub ID c2
The log
and log10
library functions
shall not be used.
Not Applicable
Sub ID d1
Zero shall not be entered for the second argument when using the
fmod
library function.
Not Applicable
Sub ID d2
The fmod
library function shall not be used.
Not Applicable
Rationale
Sub IDs a1, b1, c1, d1:
The behavior of a library function when an invalid value has been passed is dependent on the processing system and may result in unintended behavior.
Sub IDs a2, b2, c2, d2:
To avoid duplicate modeling of the same guard process in Simulink and Stateflow, use Simulink to perform arithmetic operations
Verification
Model Advisor check: Adherence to this modeling guideline cannot be verified by using a Model Advisor check.
Last Changed
R2020a
See Also
Library Development (Embedded Coder)
Version History
Introduced in R2020a