Generated code (Embedded Coder) for Mod block generates expensive function call to rt_modf

5 ビュー (過去 30 日間)
Using the built in math function block for the mod operation generates an expensive function call in the generated code.
I am using floating points and the desire is just to produce fmodf() as the result of code generation.
Anyone have any ideas? there do not seem to be any settings for this block related to CodeGen

採用された回答

Jake Gareau
Jake Gareau 2024 年 8 月 9 日
using a C code function block or a state machine with the execution set to C language, the function "fmod" from the standard math.h library can used.
Not sure if there is a way to do it natively in MATLAB or simulink but this work around gets the job done

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by