C/ C++ compiler for embedded MatLab function

I have a SimuLink model that contains an embedded function. when I tried to launch simulation, I got this error "Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks. Use 'mex -setup' to select a supported C-compiler."
I had chosen a compiler: Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files (x86)\Microsoft Visual Studio 10.0
I got always the same error when trying to run simulation.
I have MatLab 2012a Release and Windows 7 OS x64.
Thanks

回答 (3 件)

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 9 月 18 日
編集済み: Azzi Abdelmalek 2012 年 9 月 18 日

0 投票

In Matlab command write
mex -setup
choose your compiler
read the message from matlab
Mike Hosea
Mike Hosea 2012 年 9 月 18 日
編集済み: Mike Hosea 2012 年 9 月 18 日

0 投票

That should work. I'm assuming you've verified that the compiler is installed correctly and works separately from MATLAB or Simulink, and that you ran mex -setup and it didn't error. If so, I recommend contacting tech support.
paria jamshidi
paria jamshidi 2015 年 6 月 4 日

0 投票

|i installed visual studio 10 and i have matlab R2010a. i run mex -set up and chose Microsoft Visual C++ 2010 as compiler and then there are some warnninig and no error. i go to simulink and run a file(with embedded matlab function but i still have this error:Unable to locate 'mexopts.bat', and therefore cannot determine which compiler to use for simulation builds.Use 'mex -setup' to select a supported compiler.what should i do to fix the error? please help.

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

質問済み:

2012 年 9 月 18 日

回答済み:

2015 年 6 月 4 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by