フィルターのクリア

How do I tell the Simulink/Embedded Coder not to Saturate On Integer Overflow?

12 ビュー (過去 30 日間)
Marc-André Beyer
Marc-André Beyer 2014 年 6 月 10 日
回答済み: Ketan 2014 年 6 月 16 日
Hello,
I am generating code from a Simulink model that containts Matlab Function blocks which contain integer additions for array indexing. The coder generates c++ code with additional saturating code which again after deployment generates unneccessary warnings from the compiler because of possible out of bounds array access. The thing is that the results of the integer additions cannot (!) overflow, but still the saturating code is generated.
I know that there is the possibility to tell the Matlab Coder not to code saturations for integer overflow when generating code from a m-file function, but there seems to be no possibility to prevent that when generating code from Matlab Functions within a model.
Any suggestions?
Thank you!
  2 件のコメント
Ketan
Ketan 2014 年 6 月 15 日
The MATLAB Function block has a "Saturate on Integer Overflow" setting for integer arithmetic. Can you try disabling it?
You can access this property from the Ports & Data Manager:
Marc-André Beyer
Marc-André Beyer 2014 年 6 月 16 日
Yes - perfect!
Thank you!

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

採用された回答

Ketan
Ketan 2014 年 6 月 16 日
Saturate on Integer Overflow settings for the MATLAB Function block can be accessed via the Ports & Data Manager:
In this situation the setting needs to be disabled.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by