Hi, I'm working with Matlab Coder to generate C code for some Matlab files we have. So far I haven't run into any serious problems aside from some inconveniences.
Today I constructed a short function, let's say it's named FooCaller, which assigns some variables and then calls a much longer, important function named Foo. I used Matlab Coder to generate code for FooCaller and it did so dutifully, and the code works as expected, so that's great.
However, on inspecting the generated code, I see that Matlab Coder constructed a C function for FooCaller, but then pasted the code for Foo into the FooCaller function, instead of translating Foo separately and then calling the C function for Foo from the C function for FooCaller.
This is a bit of a bummer because FooCaller itself is not very important, and it will probably get replaced with some hand-written C code. Is there a way to tell Matlab Coder to construct a separate C function for each Matlab function which is encountered?
I guess I could specify all of the Matlab functions as entry points for translation, and then a separate C function would be generated for each one, right? But there are a lot of functions, so that's error prone; it would be easy to overlook one.
Thanks in advance for any light you can shed on this question.
Best Answer