Why is my 2-D array data flattened in code generation from my Simulink model using Embedded Coder but not when I use a Stateflow chart?
Show older comments
I am generating code for my model. When generating code normally, my 2-D array or matrix is flattened as shown below:
var1 = ((&my2DArray[0][0]))[4];
However, when my signals, which are handling the 2-D matrix data, are passed through a Stateflow chart in my model first, the data is represented as a 2-D array even in my generated C-code, as shown below:
var1 = my2DArray[1][2];
Why is my code generated with single indexing for matrices and 2-D arrays, but not when using a Stateflow?
Accepted Answer
More Answers (0)
Categories
Find more on Deployment, Integration, and Supported Hardware 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!