Optimization Support for Simulink Models Using Third-Party Applications
You can use Simulink® Design Optimization™ software to optimize Simulink models that invoke third-party simulation tools or contain legacy simulation code. To do so, use the S-Function block in Simulink. When using the command-line functions, use MATLAB® MEX functions.