MATLAB: Can I use the MEX-file generated by the EMLMEX command in an S-function in Simulink 7.4 (R2009b)

embeddedemlemlmexs-functionsimulink

I am using the EMLMEX command to generate a MEX-file. Can I use this MEX-file in an S-function block in Simulink 7.4 (R2009b)?

Best Answer

The ability to use a MEX-file generated by the EMLMEX command in an S-function is unavailable in Simulink 7.4 (R2009b).This is because an S-function MEX-file requires certain callbacks such as mdlInitialize, mdlOutputs, etc. which are not generated by the EMLMEX command.
As a workaround, you may use the Embedded MATLAB block in Simulink for this purpose.