如果选择Microsoft Visual Studio 2012作为matlab 的mex 编译器,在编译simulink时可能会出现"Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks. Use 'mex -setup' to select a supported C-compiler."的错误提示。
解决办法是从官网上下载一个补丁装上,链接 http://www.mathworks.com/support/bugreports/931218
如果你用的是盗版matlab,又懒得注册,也可以从这里下载