Errors related to Simulink containing Embedded Matlab Function
Show older comments
I am using Matlab R2011a version 7.12.My platform is windows 7 and 64 bit.When i try to run the simulink model containing embedded function,I get the following error.
"Making simulation target "New_sfun", ...
C:\Users\nitin\Documents\MATLAB\slprj\_sfprj\New\_self\sfun\src>call "mexopts.bat" 'nmake' is not recognized as an internal or external command, operable program or batch file. "
I installed
1.Microsoft Visual studio 2010 SERVICE PACK
2.Microsoft Visual Express c++ 2010 express
3.Microsoft Software Development kit 7.1
4 .NET Framework 4.0
Please kindly help me with this.I searched a lot in the internet,but couldn't solve my problem.
Answers (1)
Kaustubha Govind
on 24 Feb 2012
0 votes
You need to run the "mex -setup" command and select your installed compiler.
16 Comments
Nitin Reddy Ganna
on 24 Feb 2012
Kaustubha Govind
on 24 Feb 2012
Did the message from "mex -setup" says that the options file was updated successfully? Could you try deleting the "slprj" directory in the folder and try again.
Nitin Reddy Ganna
on 27 Feb 2012
Kaustubha Govind
on 27 Feb 2012
Do you have C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\nmake.exe present on your machine?
Nitin Reddy Ganna
on 28 Feb 2012
Kaustubha Govind
on 28 Feb 2012
Okay - try this in a Windows (system) command prompt:
> call "C:\Users\nitin\AppData\Roaming\MathWorks\MATLAB\R2011a\mexopts.bat"
> nmake /?
What do you see?
Nitin Reddy Ganna
on 29 Feb 2012
Kaustubha Govind
on 29 Feb 2012
Open up C:\Users\nitin\AppData\Roaming\MathWorks\MATLAB\R2011a\mexopts.bat in an editor and see if "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" is being added to the system PATH variable correctly. Note that you might need to chase down values of variables such as VCINSTALLDIR that are created earlier in the same batch script.
Nitin Reddy Ganna
on 2 Mar 2012
Kaustubha Govind
on 2 Mar 2012
See footnote#3 here: http://www.mathworks.com/support/compilers/R2011a/win64.html - by default Visual Studio only installs compilers for 32-bit targets. Since you are using 64-bit MATLAB, you need to make sure that you install the x64 Compilers and Tools package with Visual Studio.
Nitin Reddy Ganna
on 2 Mar 2012
Kaustubha Govind
on 5 Mar 2012
You shouldn't need to change the mexopts.bat file - it looks like something is wrong with your compiler installation or System PATH variable. Did you install the x64 compilers as I suggested?
Nitin Reddy Ganna
on 7 Mar 2012
Kaustubha Govind
on 8 Mar 2012
Does "mex -setup" locate your compiler automatically now?
Nitin Reddy Ganna
on 8 Mar 2012
Kaustubha Govind
on 9 Mar 2012
Okay - it looks like this is going nowhere. I would recommend contacting Tech Support if you have a license that is on maintenance.
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!