How can a saturation block emulate the option "Saturate on integer overflow" of a block?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Patricia
am 25 Mär. 2014
Beantwortet: Owen McAree
am 25 Mär. 2014
Hi,
In my models I cannot use the option "Saturate on integer overflow" due to incompatibility with MISRA rules. I need to use a saturation block instead and I was wondering which are the correct values of upper and lower limits in order to obtain the same behaviour as if I had the option checked.
Thanks in advance, Patricia
0 Kommentare
Akzeptierte Antwort
Owen McAree
am 25 Mär. 2014
Hi Patricia,
You can use the MATLAB functions intmin and intmax to get the saturation values. For example
>> intmin('int16')
ans =
-32768
>> intmax('int16')
ans =
32767
I hope this helps!
Owen
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!