'wn' is inferred as a variable-size matrix, but its size is specified as inherited or fixed.
조회 수: 18 (최근 30일)
이전 댓글 표시
I built the model in SIMULINK according to MATLAN code, expecting to get Verilog. But putting the code into the MATLAB Function module generates an error.The code is an algorithm for an LMS filter.
'wn' is inferred as a variable-size matrix, but its size is specified as inherited or fixed. Verify 'wn' is defined in terms of non-tunable parameters, or select the 'Variable Size' check box and specify the upper bounds in the Size box.
I have tried the relevant error correction, but could not solve the problem.
댓글 수: 0
답변 (1개)
Lokesh
2024년 10월 29일 10:43
Hi Wang,
The error occurs because 'wn' and 'hn_0' depend on 'N', a tunable parameter.
To resolve this issue,go to the Model Explorer and check the "Variable Size" box for 'wn' and 'hn_0'.
Initialize 'x' and 'y' outside the loop to ensure they are defined for all execution paths.
Also, ensure that the length of zeros being concatenated is greater than 0 based on your definition of 'hn_0'.
Refer to the following code for an example check:
% Ensure dimensions match for concatenation
if N > size_hn(2)
hn_0 = [hn, zeros(1, N - size_hn(2))];
else
hn_0 = hn;
end
This check is necessary because 'hn_0' is dependent on the tunable parameter 'N', which can lead to issues if 'N - size_hn(2)' is smaller than expected in various cases.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Model Verification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!