MATLAB Answers


Mex -setup compiler

Asked by Tan Edwin on 14 Feb 2011
Latest activity Commented on by Walter Roberson
on 14 Feb 2017

My MATLAB Version is (R2010b) and i am trying to run a simulink model on it.

But an error occur during the parsing phase: "Unable to locate 'mexopts.bat', and therefore cannot determine which compiler to use for simulation builds. Use 'mex -setup' to select a supported compiler."

So i t typed mex -setup in the MATLAB command prompt and it appears that there are no compiler available. So how do i get the compiler to allow my simulink model to run successfully?



what after i have downloaded the compiler. its saying somnething about the location.Though i have already installed it

nikhilsinghgangwar, which MATLAB version are you using, and exactly which compiler have you installed? Did you install VS Professional, VS Ultimate, VS Community, VS Express ?

Log in to comment.

2 Answers

Answer by Bruno Luong on 14 Feb 2011
 Accepted Answer

I guess you run Matlab on 64-bit platform (The factory LCC is the only available for 32). A free compiler is Microsoft Visual Studio Express. You need to download and install it.


Log in to comment.

Answer by Andreas Goser
on 14 Feb 2011

I also would guess this is that you need to install a C compiler. Here is the full list:

Supported C Compilers R2010b Win64

I heard people struggling with not correctly applying the right SDK for the MSVC Express editions, so my advice is to look at this very carefully.


Log in to comment.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!