필터 지우기
필터 지우기

Running code inspector with a For Loop Iterator

조회 수: 9 (최근 30일)
Mathieu
Mathieu 2024년 3월 18일
편집: Mathieu 2024년 3월 29일
Hello,
I have a model running with a For Iterator (to read an Input Array and write some of its datas to another one shorter array).
The model must go through both Model Advisor and Code Inspector to be embedded in the calculator.
As for the Model Advisor everything is passed and generated code is about 120 lines, however when I try to run the code inspector, it runs for more than 2.5hrs (on the inspection only) and I am forced to kill the Matlab task afterward because it stops running. Here is a screenshot of the model.
Here is what I tried:
  • include the "add" and the "unitDelaty" inside the referenced model => it creates an algebraic loop
  • add the triggered block within a referenced model => impossible as it contain an "assignement" block and therefore cannot be referenced.
  • Simplify the referenced model to reduce load capacity of the model containg.
I can provide the generated C code if necessary
Thank you,

답변 (1개)

Debadipto
Debadipto 2024년 3월 28일
It's difficult to tell exactly what's causing the Code Inspector to slow down by just looking at the model. Could you please check if the iteration count, denoted by the parameter 'N' in the For Iterator, is not set too high?
I recommend reaching out to MathWorks Technical Support for further assistance with this issue:
https://www.mathworks.com/support/contact_us.html
  댓글 수: 1
Mathieu
Mathieu 2024년 3월 29일
편집: Mathieu 2024년 3월 29일
Hello,
Iteration count is set to the length(Priority - 7) with Priority an array[76] of uint8 hence there is 69 iterations tops.
Due to inconsistent behavior with the for iterator block (States when starting: reset is erratically holding values) I used a MATLAB function (which is easier) instead of the model and the issue with the Code Inspector is still here (while the code is not that big ~80lines).
I will try to contact the Technical support and update this ticket consequently.
Thanks,

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

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by