错误信息:
"Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.Use 'mex -setup' to select a supported C-compiler."
使用mex -setup 选择VS2012之后还是出错,使用低版本2010a或者高版本2014b时可以运行。
参考Mathworks的官方支持,发现bug及解决方案如下:
Summary
Stateflow charts and MATLAB Function blocks do not work with Microsoft Visual Studio (MSVC) 2012.
Description
When you select Microsoft Visual Studio (MSVC) 2012 as your MEX compiler, you get an error if you try to update a Simulink model that contains Stateflow charts or MATLAB Function blocks. Here is the error message:
"Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks. Use 'mex -setup' to select a supported C-compiler."Workaround
Installation instructions