Hi Veera,
The "rt_InitInfAndNaN" function is a support routine inserted automatically when your model may involve special floating-point values, such as:
- NaN (Not a Number)
- Inf (Infinity)
Its purpose is to initialize platform-specific representations of these values so they can be used reliably in the generated code. You need to remove this function, you must ensure that your model does not require non-finite values.
You can do this by changing the following code generation settings:
- Go to Model Configuration Parameters
- Under Code Generation > System target file : Ensure it is set to 'ert.tlc'.
- Go to Code Generation > Interface tab: Set "Support non-finite numbers" to OFF and Set "MAT-file logging" to OFF if not needed.
Disabling support for non-finite numbers tells Embedded Coder that your application will not use NaN, Inf, or -Inf, allowing it to omit rt_InitInfAndNaN from the generated code.
For more information regarding "rt_InitInfAndNaN", kindly refer to the following MATLAB documentation: