MATLAB: [HDL Coder]: BUG?/ Function Location missing in Error Report -> find variable by name

HDL Coder

In HDL Coder, I want to locate, where errors are occuring.
But the HTML Report just gives me the Error Location in the top compiled file,
not in the function file and line where it really occurs.
Example
dut_wrapper_fixpt:15 |Error |'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
dut_wrapper_fixpt:15 |Error |'signal' : Error: variable-size matrix type is not supported for HDL code generation.
dut_wrapper_fixpt:15 |Error |'a0' : Error: variable-size matrix type is not supported for HDL code generation.
dut_wrapper_fixpt:15 |Error |'var_1' : Error: variable-size matrix type is not supported for HDL code generation.
dut_wrapper_fixpt:15 |Error |'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
But at dut_wrapper_fixpt.m line 15 is only the call to a function in which all the errors occur.
Can I find the location of varargin & others by their name? var_1 (or var) for example does not even occur in my source.

Best Answer

As long a the location of error lines is not shown correctly in MATLAB HDL Coder,
assign the top function call as a
var = coder.const(your_function(constantA,constantB))
and run the fixed point designer. It will complain, that the expression cannot be reduced to a constant.
Then open the fixed-point designers error report and hover over variables you expect to be problematic.
If you find the variables size to be something like 1x:?, then you found the problematic spot.
Related Question