How to saturate a variable according to my range in RTW embedded coder
이전 댓글 표시
Hi, I 'm generating an Auto code using an RTW embedded coder. I'm facing staturation issue when i tested the code. problem is saturating my variable according to my range of that variable is not taking, it takes as per the datatype of variable.
For ex: input variable name : abc
range : [0..255]
datatype: uint8
output variable name: out
range: [0..254]
datatype: uint8
implementation in model is out = abc + 1
generated code for this add block will be like
tmp = abc + 1 ;
if(tmp >255)
{
out = 255;
}else{
out = tmp;
}
Now out variable range will be limited to 255 but i need it till 254
How to set the staturation with my range for an output variable.
please help me!!!
Thanks and Regards, Nithin
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!