How to use integer rounding modes in C based statechart ?

4 ビュー (過去 30 日間)
Swapnil Kulkarni
Swapnil Kulkarni 2018 年 1 月 30 日
コメント済み: Swapnil Kulkarni 2018 年 1 月 31 日
I want to use integer rounding mode "round" in arithmatic operation, inside c- based statechart. Unfortunately "round" function is not supported in C-based statechart so is there any alternative ?
By default flooring operation takes place. e.g. when division operation results in 500.0998 it should be rounded up to 501 when conevrted into integer buts its giving it as 500.

回答 (1 件)

Abhishek Ballaney
Abhishek Ballaney 2018 年 1 月 30 日
https://in.mathworks.com/help/simulink/slref/coder.ceval.html
  1 件のコメント
Swapnil Kulkarni
Swapnil Kulkarni 2018 年 1 月 31 日
Thanks Abhishek for the link. But I think this link not very useful for me, Since I need to call the function from Statechart and not from generated code of m file.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by