Matlab Coder ERROR: Dimension _ is fixed on the left-hand side but varies on the right.
이전 댓글 표시
I had the same problem in this post but it was in Simulink. I solved that one by using a reshape block.
However, now I am trying to compile a Matlab script using the coder. The script is working without any problem and the variable which is complaining about is not growing. It is defined inside the code as a merge of some others that are not either growing or changing shape.
This is the error:
Dimension 1 is fixed on the left-hand side but varies on the right ([3 x :? x 4] ~= [:? x :? x :?]).
I tried to use reshape specifying the fixed numbers but even like this it did not like it.
Any suggestions?
댓글 수: 5
dpb
2014년 5월 27일
And we're supposed to be able to answer something sentient w/o a line of code in sight???
Dani Tormo
2014년 5월 28일
There's no cross-reference or code line where the error was generated? You mention the function of the code you're questioning -- at least paste the pertinent stuff around there w/ a few additional lines that show the definitions of the variables involved.
Sounds like a case where Matlab automagic memory reallocation is more than the code generator knows how to handle. You may have to explicitly allocate a target to help it along but there's not much anybody else can do with absolutely nothing to even have a hint over what you're trying to compile...the crystal orb is totally dark on this one, sorry.
Ketan
2014년 6월 2일
Here are some ideas:
- Are the sizes of any variables dependent on values of any entry-point inputs? In your previous post you mentioned sizing using non-tunable parameters. The equivalent in MATLAB Coder is to specify an input using a coder.Constant.
- You can use the report to trace backwards from the site of the error and analyze the upstream code that is causing the rhs to be inferred as [:? x :? x :?].
Image Analyst
2014년 6월 3일
You can attach your 1370 lines (your m-file) via the paperclip icon. dpb, you'd better get your advance order in for the Crystal Ball Toolbox because I'm sure it will be a sellout for the first few months.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Whos에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!