After designing my state machine using matlab state flow and generating its C code using code generation, I could easily run it in my application in visual studio. However, after a while I needed to call specific functions at each state transitions. And it is important to mention that each transition can have its own functions.
For those who are pro in both c and matlab, I think this issue can be solved if there is a way that matlab code generation, generates __weak callback functions for each state transition. In that case, I can fill the body of these callback functions and whenever state transitions happen, generated code will call them and my methods will be executed. I could not find any way to force matlab to generate these callback functions. Is this available in matlab or are there any other solutions to overcome this issue?
Another solution is to call the name of my functions in matlab state flow at each transition and let matlab know that these functions will be defined later in my application, so that it won't give me errors for generating the c code. However I could not figure out this one too!