codegen : how to get rid of memset and memcpy in generated code in matlab?
<p>I am trying to generate a static c lib from a matlab function.The generated code includes memset and memcpy function calls which I do not want because I want to use this code in vivado HLS for an FPGA project and these two operations are not permitted.</p>

<p>I have tried the following
1) Unchecking "Enable variable sizing" from the Matlab coder app.
2) Used the following command line script </p>

<pre><code>cfg = coder.config('lib');
cfg.GenCodeOnly = true;
cfg.EnableVariableSizing = false;
cfg.EnableMemcpy = false;
cfg.SupportNonFinite = false;
cfg.InitFltsAndDblsToZero = false;
cfg.FilePartitionMethod = 'SingleFile';
cfg.DynamicMemoryAllocation = 'off';
codegen -config cfg harris -args { zeros(640,480,'uint8'),zeros(1,1,'int32')} 
</code></pre>

<p>The line <strong>cfg.InitFltsAndDblsToZero = false;</strong> is supposed to eliminate memset calls for initializing arrays,but in my generated code I still see memset function calls.</p>

<p>So, both methods do not work for me.</p>

<p>Please, tell me if it requires more changes in configuration and if this is possible through the matlab coder gui?</p>

<p>P.S.
I have used this link to set codegen configuration object properties <a href="http://www.mathworks.com/help/coder/ref/coder.embeddedcodeconfig-class.html" rel="nofollow">http://www.mathworks.com/help/coder/ref/coder.embeddedcodeconfig-class.html</a></p>