Matlab Coder : Matlab Array to C Array -
i used matlab coder convert matlab code c. simple array had defined in matlab got converted complicated struct in c.
struct emxarray_real_t { double *data; int *size; int allocatedsize; int numdimensions; boolean_t canfreedata; }; it of great if can shed light on how work struct.
the type emxarray_real_t created because matlab coder unable determine fixed size or sufficiently small bounds on size array in matlab, 2x3. in case generated code allows size of array vary @ runtime using dynamic memory allocation (e.g. malloc) , data structure represent matlab array in c. these called dynamically allocated variable size arrays in matlab coder documentation , struct fields used track dynamically allocated memory in generated code.
regarding working such arrays, documentation recommended @horchler place start. also, can have @ other answer describes basics of working same struct when stored data uint32 rather double or real_t in case.
Comments
Post a Comment