jc_0805: Numerical operation block inputs
Since R2020a
Guideline Publication
Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®
Sub ID Recommendations
NA-MAAB — a1/a2, b, c1/c2, d, e, f1/f2, g, h, i, j
JMAAB — a1/a2, b, c1/c2, d, e, f1/f2, g, h, i, j
MATLAB Versions
All
Rule
Sub ID a1
When using and Abs block with signed integer types, the input shall not be the most negative value.
Not Applicable
Sub ID a2
Abs block parameter Saturation on Integer Overflow shall be selected.
Not Applicable
Sub ID b
Input to the Abs block shall not be unsigned integer types or fixed-point types.
Not Applicable
Sub ID c1
Input to the Sqrt block shall not be a negative value.
Not Applicable
Negative number is saturated with 0.
Simulation result
Sub ID c2
Sqrt block parameter
Output Signal Type shall be set to
complex
.
Not Applicable
Sub ID d
Input to the Reciprocal Sqrt block shall not be less than zero.
Not Applicable
Less than eps saturated with eps.
Simulation result: Plot as Y=log10(Z)
Sub ID e
When Math Function block parameter
Function is set to log
or
log10
, the input to the block shall not be zero.
Not Applicable
Replace within ±eps with ±eps
Simulation result: Plot as Y = |Z|
Sub ID f1
When Math Function block parameter
Function is set to log
or
log10
, the input to the block shall not be a negative
number.
Not Applicable
When the input is less than eps, the value is saturated to eps. Less than eps saturated with eps.
Simulation result
Sub ID f2
When Math Function block parameter
Function is set to log
or
log10
, block parameter Output Signal
Type shall be set to complex
.
Not Applicable
Sub ID g
When Math Function block parameter
Function is set to mod
or
rem
, the second argument input shall not be zero.
Not Applicable
Sub ID h
When Math Function block parameter
Function is set to reciprocal
,
the input to the block shall not be zero.
Not Applicable
Replace within ±eps with ±eps
Simulation result: Simulation results is not inf, but since it is close to zero, the change in the output value is significant.
Sub ID i
When Product block parameter
Multiplication is set to
Element-wise(.*)
, the divisor input shall not be zero.
Note
To specify a divisor input, set Product block parameter
Number of inputs to
*/
.
Not Applicable
Sub ID j
When Product block parameter
Multiplication is set to
Matrix(*)
, the divisor input shall not be set to a singular
matrix.
Note
To specify a divisor input, set Product block parameter
Number of inputs to
*/
.
Not Applicable
Rationale
Sub IDs a1, c1, d, e, f1, g, h, i, j:
The result of entering an invalid value is implementation dependent. Deviation from the rules can result in unintended behavior.
Sub ID a2:
Correct settings prevent unintended behavior that can result from using invalid values.
Sub ID b:
The block can become optimized out of the generated code, resulting in a block that you cannot trace to the generated code.
Sub IDs c2, f2:
Correct settings prevent unintended behavior that can result from using negative values.
Verification
Adherence to this modeling guideline cannot be verified by using a Model Advisor check.
Last Changed
R2020a
Version History
Introduced in R2020a