- Outside the subsystem one hierarchic level above the function
- In another subsystem at the same hierarchic level as the function
- In another subsystem one or more levels below the hierarchic level of the function
How do I call Simulink function in nested subsystem?
조회 수: 5 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2017년 3월 29일
편집: MathWorks Support Team
2023년 5월 4일
I have a Simulink function 'MyFun' in a subsystem named 'S1' which is a subsystem of 'S2'. I am getting the following error when I call this function from the top level:
ERROR: A definition for the function 'MyFun' called by Function Caller block could not be found.
How can I call the function 'MyFun' from the function caller?
채택된 답변
MathWorks Support Team
2023년 5월 4일
편집: MathWorks Support Team
2023년 5월 4일
This is an expected behavior. As mentioned in the following documentation:
a function caller can be at a level where it can hierarchically resolve to the subsystem containing the function. Hence, we can only call a function from:
Therefore, if the function needs to be accessed at a higher hierarchy, then the function should be moved up so that the caller will be in it's hierarchy.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!