Error: variable-size matrix type is not supported for HDL code
I use the fixed-point tool to fixed-point the subsystem and then generate Verilog, but the following error occurs.
The model contains constructs that are unsupported for HDL code generation. HDL Coder ‘c’ : Error: variable-size matrix type is not supported for HDL code generation. Function ’eml_fixpt_times’ (#33554529.1887.1910), line 65, column 5 Function ‘times’ (#33554530.5290.5318), line 146, column 27 Function ‘mtimes’ (#33554528.2252.2264), line 62, column 9 Function ‘forSubsystem/MATLAB Function1/MATLAB Function1_FixPt’ (#369.531.542), line 23, column 13
In #369.531.542, the error is related to miu*x*en(i), i tried to use sss=miu*x*en(i) instead, but it ended up showing Subscripted assignment dimension mismatch: [1] ~= [5]. Error in ‘testfixed/testforSubsystem/MATLAB Function’ (line 23) sss = miu*x*en(i);
I fixed the above problem,
sss= zeros(1,5);
sss = miu*x*en(i);
wn(:)=wn+sss;
but still failed to generate Verilog,
The model contains constructs that are unsupported for HDL code generation. HDL Coder ‘c’ : Error: variable-size matrix type is not supported for HDL code generation. Function ’eml_fixpt_times’ (#33554529.1887.1910), line 65, column 5 Function ‘times’ (#33554530.5290.5318), line 146, column 27 Function ‘mtimes’ (#33554528.2252.2264), line 62, column 9 Function ‘forsubsystem/MATLAB Function’ (#998.580.591), line 23, column 1
The key to the error is on en(i), why does it cause this error?I use the fixed-point tool to fixed-point the subsystem and then generate Verilog, but the following error occurs.
The model contains constructs that are unsupported for HDL code generation. HDL Coder ‘c’ : Error: variable-size matrix type is not supported for HDL code generation. Function ’eml_fixpt_times’ (#33554529.1887.1910), line 65, column 5 Function ‘times’ (#33554530.5290.5318), line 146, column 27 Function ‘mtimes’ (#33554528.2252.2264), line 62, column 9 Function ‘forSubsystem/MATLAB Function1/MATLAB Function1_FixPt’ (#369.531.542), line 23, column 13
In #369.531.542, the error is related to miu*x*en(i), i tried to use sss=miu*x*en(i) instead, but it ended up showing Subscripted assignment dimension mismatch: [1] ~= [5]. Error in ‘testfixed/testforSubsystem/MATLAB Function’ (line 23) sss = miu*x*en(i);
I fixed the above problem,
sss= zeros(1,5);
sss = miu*x*en(i);
wn(:)=wn+sss;
but still failed to generate Verilog,
The model contains constructs that are unsupported for HDL code generation. HDL Coder ‘c’ : Error: variable-size matrix type is not supported for HDL code generation. Function ’eml_fixpt_times’ (#33554529.1887.1910), line 65, column 5 Function ‘times’ (#33554530.5290.5318), line 146, column 27 Function ‘mtimes’ (#33554528.2252.2264), line 62, column 9 Function ‘forsubsystem/MATLAB Function’ (#998.580.591), line 23, column 1
The key to the error is on en(i), why does it cause this error? I use the fixed-point tool to fixed-point the subsystem and then generate Verilog, but the following error occurs.
The model contains constructs that are unsupported for HDL code generation. HDL Coder ‘c’ : Error: variable-size matrix type is not supported for HDL code generation. Function ’eml_fixpt_times’ (#33554529.1887.1910), line 65, column 5 Function ‘times’ (#33554530.5290.5318), line 146, column 27 Function ‘mtimes’ (#33554528.2252.2264), line 62, column 9 Function ‘forSubsystem/MATLAB Function1/MATLAB Function1_FixPt’ (#369.531.542), line 23, column 13
In #369.531.542, the error is related to miu*x*en(i), i tried to use sss=miu*x*en(i) instead, but it ended up showing Subscripted assignment dimension mismatch: [1] ~= [5]. Error in ‘testfixed/testforSubsystem/MATLAB Function’ (line 23) sss = miu*x*en(i);
I fixed the above problem,
sss= zeros(1,5);
sss = miu*x*en(i);
wn(:)=wn+sss;
but still failed to generate Verilog,
The model contains constructs that are unsupported for HDL code generation. HDL Coder ‘c’ : Error: variable-size matrix type is not supported for HDL code generation. Function ’eml_fixpt_times’ (#33554529.1887.1910), line 65, column 5 Function ‘times’ (#33554530.5290.5318), line 146, column 27 Function ‘mtimes’ (#33554528.2252.2264), line 62, column 9 Function ‘forsubsystem/MATLAB Function’ (#998.580.591), line 23, column 1
The key to the error is on en(i), why does it cause this error? simulink model, variable-size, generate code MATLAB Answers — New Questions