Matlab Simulink and Stateflow gotchas while running simulation with code generation with M functions
While in Simulink and Stateflow, if you use Matlab M functions it appears all local function variables need to be defined in the workspace. While running the simulation you can get errors like:
Undefined function or variable ‘m’. The first assignment to a local variable determines its class.
Function ‘rsi’ (#89.382.383), line 17, column 2:
Launch diagnostic report.
While in SImulink and Stateflow, if you use Matlab M functions it appears all local function variables need to be defined in the workspace. This is needced
for the Coder during the code generation process. I am sure there is a smarter way but I will dig into it in the near future.
Hope this helps somewhat so far.
Also, when using Stateflow transitions for Matlab M functions, you need to define the M function on the transition as explained here:
I will post a full set of files with C++ code generated file. Want to know when that happens, join my FREE newsletter
NOTE I now post myTRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!
How do I reverse engineer those algorithms and functions in C++ that Matlab Coder toolbox does not support?
After my sticker shock on the prices of FPGA, I decided to crawl back to reality to re-investigate CUDA and all those algorithms from my Matlab strategies. How do i get them into C++ as Matlab don’t support them. Thankfully, there is maybe one library that enables me to do it. I just do got to reverse engineer thar process to complete the Matlab Coder conversion process from Matlab M to C++. I hope to have a video for my QuantLabs.net Premium Members. JOIN now before my rates go up.