MATLAB: [Coder] Which types are supported for constant folding

coderHDL Codermatlab coder

In MATLAB HDL coder I try to do constant folding on the output of a function.
The output type is a 1×262144 uint16.
The coder complains with:
The input to coder.const cannot be reduced to a constant: Unsupported type.
Which types are supported?

Best Answer

I did understand constant folding wrong:
I thought one must help the coder as follows:
a = coder.const(my_prod(3,2));
, because the gui of the fixed point converter was still complaining about a unsupported function in
my_prod
But the statement is already recognized as constant.
coder.const
just needs to be used, if you call a function multiple times with different input parameters
and you want the coder to create the function multiple times, each time with all of the parameters constant.