How can I call a simulink function from within an own s-function block?
(There are examples of how to output a function call triggering a function call subsystem. But that's not intended.)
Basically I want to rebuild the existing "Function Caller" block with an own s-function. How does s-function code look like for such an approach?
And will it be linked/ shown by function connectors if simulink function is provided?
Thanks.

 채택된 답변

Sivsankar
Sivsankar 2025년 3월 6일

1 개 추천

It is indeed possible to call a Simulink function from an S-function. For a comprehensive understanding of the various methods to call a Simulink function, please refer to the following MathWorks documentation:
To learn about declaring a call from an S-function, you can consult the documentation on 'ssDeclareFunctionCaller':
For information on making the actual call at runtime using 'ssCallSimulinkFunction' (which should be implemented in either the mdlUpdate or mdlOutput methods), please see the following resource:

댓글 수: 1

Mario Weyrich
Mario Weyrich 2025년 3월 13일
편집: Mario Weyrich 2025년 3월 14일
:) Thank you very much, that helped a lot!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

릴리스

R2024b

질문:

2025년 3월 3일

편집:

2025년 3월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by