How to recompile S-functions in Simulink?

조회 수: 8 (최근 30일)
Laurent Vermeulen
Laurent Vermeulen 2015년 3월 30일
답변: Abhishek GS 2015년 4월 10일
When executing my Simulink program, containing S-functions, I get the following error:
To use block 'Environnement/S-Function' in referenced models, recompile the S-function with the current version of Simulink.
The S-function I'm trying to use is one I downloaded, but I changed the code and made a new function with the new code.
How can I recompile this S-function and get rid of this error?
Thanks

답변 (1개)

Abhishek GS
Abhishek GS 2015년 4월 10일
Hi Laurent,
I am guessing you have edited the C S-Function. Once you have changed the C S-Function, you have to mex it inorder to compile and use in Simulink as a block. The command is
>>mex filename.c
Refer this link for an example.
Hope this helps, Abhishek

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by