Placing a Matlab function block with a call to a Simulink function in a for each subsystem
조회 수: 3 (최근 30일)
이전 댓글 표시
I have a Matlab function block that calls a Simulink function. I am trying to place this block into a for each subsystem and i get the following error.
The MATLAB Function cannot be placed inside a subsystem containing a "For Each" block. This might be because of one or more of the following reasons: 1. The MATLAB Function has a data with scope "Data Store Memory". 2. The MATLAB Function calls Simulink functions.
Is there a workaround to this problem ?
댓글 수: 0
답변 (1개)
Shivansh
2024년 5월 26일
Hi Rishab!
I understand that you are facing an error while putting a MATLAB function block containing data with scope "Data Store memory" inside a for each subsystem.
A possible workaround can be to remove the global variable from the MATLAB Function block and pass it as an input to the MATLAB Function block. You can use a Data Store Read outside the For Each Subsystem, use it as an input to the Subsystem, and then pass it to the MATLAB Function block as an input argument.
You can refer to the following documentation to know more about the limitations of For Each Subsystem: https://www.mathworks.com/help/simulink/ug/repeat-an-algorithm-using-a-for-each-subsystem.html#mw_76ab6d1d-3ef6-4c2e-9438-e226c070ddc0.
I hope it helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Subsystems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!