How to optimize the coder generated code to use pointer as input instead of structure ?
22 views (last 30 days)
My matlab function is this :
[staticAlign_output, per_var] = staticAlignment(staticAlign_input, staticAlign_output, detn_reports, per_var, sa_cals)
Therefore the auto generated c code for this function is like this:
void staticAlignment(const staticAlign_Input_T staticAlign_input,
const Detection_Reports_T detn_reports , Per_Var_T *per_var, const
So it calls the sttucture Detection_Reports_T as the input. Since this is a huge structure, we prefer to use pointer instead of structure.
Is there a command to fix this ?
Fred Smith on 7 Nov 2013
If you make detn_output an output as well, then it will be passed by pointer.
What version of MATLAB Coder are you using? In the latest release (I believe), all structures should always be passed by reference.