In MATLAB R2024a/b, why are support files like rtGetInf.c/.h and rtGetNaN.c/.h not generated for *.mdl model

11 views (last 30 days)
In MATLAB R2024a/b, why are support files like rtGetInf.c/.h and rtGetNaN.c/.h not generated during code generation for .mdl models, even when the "Support non-finite numbers (NaN or Inf)" option is enabled. While the same files are correctly generated for .slx models with identical configuration settings?
this is working in m2023b and below, Issue is only above m2024a.

Answers (1)

Nithin
Nithin on 9 Jun 2025
Hi @Varsha,
The files "rtGetinf.c" and "rtGetInf.h" were generated for declaring and initializing global nonfinite values like "inf". These are auto-generated shared utility files.
Starting in R2024a, instead of generating separate utility files like "rtGetInf.c", "rtGetNaN.c", the code generator now uses a single optimized utility file called "rt_nonfinite.c", which handles all nonfinite values. This change reduces the number of generated files and simplifies integration, but it behaves differently based on the model file format and the selected language standard.
".mdl" models are supported for backward compatibility, but some code generation features and optimizations are applied differently compared to ".slx" models. This includes how utility files like "rtGetInf.c" are handled.
If you need the old files like "rtGetInf.c/.h", you can:
  1. Change the "Target Language Standard" by setting it to "C89/90 (ANSI)" instead of the default "C99 (ISO)"
  2. Migrate the model to ".slx" format using "save_system('yourModel', 'yourModel.slx')" and generate code from the ".slx" model which will ensure the new "rt_nonfinite.c" is generated correctly.
Refer to the following documentation for more information:

Categories

Find more on Interactive Model Editing in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!