Size mismatch using reshape in HDL Coder

조회 수: 2 (최근 30일)
Alla
Alla 2018년 11월 2일
댓글: Bharath Venkataraman 2018년 11월 2일
I have an 8x8 input matrix, since 2D matrices aren't supproted I reshape it to 64x1 for the input and then reshape it back within the function using A=reshape(A, 8, 8); it runs well in Matlab but the code generation spits out this error:
Size mismatch (size [64 x 1] ~= size [8 x 8]). The size to the left is the size of the left-hand side of the assignment.
What's odd is that the problem seems to have came out of nowhere because I'm almost certain It was working well and I didn't change anything then it just started to error.

채택된 답변

Bharath Venkataraman
Bharath Venkataraman 2018년 11월 2일
Could you try assigning the value to a different variable rather than back to A. Ar = reshape(A,8,8);
use Ar in the code below.
  댓글 수: 2
Alla
Alla 2018년 11월 2일
Thank you, this seems to have solved the problem although I tired it earlier and it didn't.
If I may ask another question, something more basic, when I generate HDL code for a function that calls an other function, how does the generated code deal with that? does it include the called functions?
Bharath Venkataraman
Bharath Venkataraman 2018년 11월 2일
Yes, all sub-functions should also be covered by HDL Coder.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by