MATLAB: I am getting the below mentioned problem when I am simulating “Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks. Use ‘mex -setup’ to select a supported C-compiler.”

mex -setup

I am getting the below mentioned problem when I am simulating "Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks. Use 'mex -setup' to select a supported C-compiler."

Best Answer

Shailesh, as the msg implies you need to tell MATLAB which compiler should be used. Which, of course, means that there needs to be at least one compiler installed on your system. Then simply run
mex -setup
in the command window and choose the/a compiler.