Install a supported compiler
Simulink support package for Arduino is supported on 32-bit and 64-bit Microsoft Windows and Mac OS X. For the code generation process to work, a supported compiler installation is required. Refer to the following page on MathWorks website for a list of supported compilers on Windows and Mac OS:
List of supported compilers
For example, you can download a Simulink supported compiler from the Microsoft website for free.
Compiler set up in MATLAB
mex -setup at the MATLAB command prompt to start the compiler set up. When the compiler set up is complete, you should see on MATLAB Command Window the compiler being used.