MATLAB: Can the functions mdlstart and mdlterminate not be edited inside the S-function Builder in Simulink

buildermdlstartmdlterminates-functionsimulink

In the S-function Builder I can choose to generate a function 'mdlstart' and a function 'mdlterminate' under 'Build Info -> Additional methods'. These functions need to be edited in the generated code.

Best Answer

This functionality is available in MATLAB R2017b.
For releases prior to MATLAB R2017b, the ability to edit the 'mdlstart' and 'mdlterminate' functions inside the S-function Builder is not available in Simulink.
To work around this issue, press the 'Build' button and edit the functions in the generated source file.
Please note that any modifications you make to the source code will be overwritten when the S-Function is built again. You may want to save your mdlstart and mdlterminate code in a text file so that you can paste it back into the source files when the S-function is re-built.