I am building a binary from C++ code using Mex. I want to use this binary in Simulink—without calling it externally.
How can I use an S-function for this? Note, I use external libraries and several source files. Ideally, I could use the same line of code to compile Mex from Matlab as Simulink.