MATLAB: Do I receive an error in the Simulink S-function when I compile it using the MCC command provided by the MATLAB Compiler 3.0 (R13)

%scompilerMATLABMATLAB Compilermccmexs-functionsimulink

I receive the following error when I try to compile my Simulink S-function using the MCC -S command provided by the MATLAB Compiler 3.0 (R13):
S-function parameter count mismatch - S-function <filename> in block <blockname> is expecting 0 parameters while 3 were provided in the block dialog box.

Best Answer

This error occurs due to a limitation of the MCC command with the '-S' option. The 'MCC -S' option does not support passing parameters through the S-function, which is normally available in Simulink S-functions. Hence, the error message reports that the S-function expects 0 parameters, while you are actually passing 3 parameters to the S-function.