Embedded Coder give uncompilable code using dynamic arrays
1 view (last 30 days)
When generating C++ code an error occurs. Using dynamic arrays (not statically reserved memory) in matlab results in generated code that uses data structures of type array and b_array, where b_array is undefined. Hence, trying to use Embedded Coder with Matlab 2020a might give uncompilable code.
Appreciate any feedback and help on this issue.
Ryan Livingston on 25 Sep 2020
This is a bug and has been reported to our development team. In addition to the postprocessing workaround suggested by Glenn, you can disable coder::array if you're OK using emxArrays instead:
cfg = coder.config('lib');
cfg.DynamicMemoryAllocationInterface = 'C';
codegen f -args 1 -lang:c++ -config cfg -report