Can I change the name of a function during codegen?
Show older comments
Can I change the name of a function during codegen? For example, if I hava a Matlab function called foo, can I make its genrated C function name be something like foo_cg (_cg for CodeGen)?. The motivation for this is that I have a custom version of the C foo and legacy code that uses it, and I don't want to change that code. I also have legacy Matlab code that uses the Matlab foo, so I don't want to changes its name either.
Accepted Answer
More Answers (1)
Jeff Tackett
on 4 Mar 2025
1 vote
Starting in R21a, you can configure generated code naming via: CustomFileNameStr
In the MATLAB Coder GUI, it looks like:

Categories
Find more on Algorithm Design Basics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!