Embedded MATLAB function block in simulink is not working.

Asked by Md Rakibul on 20 Jul 2012
Latest activity Answered by Azzi Abdelmalek on 25 Sep 2012

Hello,

My MATLAB version is r2010a. I am trying to us Embedded MATLAB function block in simulink and is not working. For example, i am giving a simple input to the block and want to see the output but the model is not going through. It is giving error as below:

Unable to locate 'mexopts.bat', and therefore cannot determine which compiler to use for simulation builds. Use 'mex -setup' to select a supported compiler.

I installed vs express and run mex -setup and select the Compiler: Microsoft Visual C++ 2008 Express but still is not going through. Can anyone give me solution please? Thank you.

Rakibul Hasan

1 Comment

Walter Roberson on 22 Jul 2012

Please review the guidelines about tags to avoid, and retag this question. http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags

Md Rakibul

Products

3 Answers

Answer by Kaustubha Govind on 20 Jul 2012

You might be missing the Windows SDK installation. Please see this solution for more information. Also, if you are using 64-bit MATLAB, make sure that the "x64 Compilers and Tools" box is selected during the Visual Studio installation (I think only the 32-bit compiler is installed by default) - see this solution for more information.

0 Comments

Kaustubha Govind
Answer by Walter Roberson on 25 Sep 2012

Please review the guidelines about tags to avoid, and retag this question. http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags

0 Comments

Walter Roberson
Answer by Azzi Abdelmalek on 25 Sep 2012
If you have a 64 bit windows and  have'nt yet find a solution to your problem  , I advice you, to install the Matlab 32 bits, that allows you to do what is needed. then after try to resolve your problem as mentioned by Kaustubha. It will be better if you unistall your msv c++ express, then reinstal, NetFramework 4.0 and msv c++ 2008, and Sdk 7.1

http://www.microsoft.com/fr-fr/download/details.aspx?id=17851

http://www.microsoft.com/en-us/download/details.aspx?id=6506

http://www.microsoft.com/fr-fr/download/details.aspx?id=27570

0 Comments

Azzi Abdelmalek

Contact us