Matlab Cannot Find Installed Compiler
Do not use ``mex -setup``.
mex -setup
is used for setting the PC compiler for compiling S-functions. The embedded software compiler is set in the “Code Generation” tab in Simulink.
To select your embedded compiler:
Open Simulink model.
Click “Simulation” > “Model Configuration Parameters”.
Expand “Code Generation” or “Real-Time Workshop”.
Select “OpenECU compiler selection”.

If “Code Generation” or “Real-Time Workshop” isn’t visible, you may not have a licensed Simulink Coder. Contact Mathworks for assistance.
If the compiler is not in the dropdown, consider adding an environment variable for your compiler.