In terms of performance, I don't believe that there is a significant difference between Embedded MATLAB Function and C/C++ S-functions (although I suspect S-functions are leaner). However, there are a couple of differences I can think of, otherwise:
- Since you intend to generate embedded code for these blocks, S-functions will require you to write TLC scripts, whereas, Embedded MATLAB takes care of code generation for you.
- S-functions allow you much more control over your block, such as maintaining state vectors and customizing block callback methods such as mdlEnable, mdlUpdate, mdlZeroCrossings, etc. Embedded MATLAB blocks have only one function (which is the equivalent of a combined mdlUpdate and mdlOutputs).
In summary, the choice is between speed of development and control over block implementation.
