Generate C code from co-simulation model Simulink-MSC. ADAMS/Car

Hello:
I am trying to optimize my model parameters through design of experiments. So I have to run several simulations. What I want is to generate C-code from my simulink model. It has inside a block from MSC.ADAMS/Car to run in co-simulation. I want to know if this process is possible. I have already tried it but the error says:
_Invalid setting for environment variable MSDevDir or DevEnvDir.
The setting is: ''
You can verify the setting by checking for the existence of:
%DevEnvDir%\..\tools\vsvars32.bat (for Visual C/C++ 9.0)
%MSDevDir%\..\..\vc98\bin\vcvars32.bat (for Visual C/C++ 6.0)
%DevEnvDir%\..\tools\vsvars32.bat (for Visual C/C++ 8.0)
You must define MSDevDir or DevEnvDir to be:
set %DevEnvDir%=<VisualRoot>\common7\ide (for Visual C/C++ 9.0)
set %MSDevDir%=<VisualRoot>\common\msdev98 (for Visual C/C++ 6.0)
set %DevEnvDir%=<VisualRoot>\common7\ide (for Visual C/C++ 8.0)
_This error may be due to an invalid preference file:
C:\Documents and Settings\javgut\Datos de programa\MathWorks\MATLAB\R2010a\mexopts.bat
Please run "mex -setup" at the MATLAB prompt to correct_
At the beginning of the Matlab session I run the command mex -setup and selected the compiler by default. Is there any solution?
Thank you very much in advance

4 comentarios

Three questions:
1) Are you on 32-bit or 64-bit MATLAB?
2) Which compiler did you select with "mex -setup"? Is it one of the supported ones: http://www.mathworks.com/support/compilers/R2010a/win32.html
3) If you are on 32-bit, could you try selecting LCC as the MEX compiler and see if that fixes the error?
The error message seems to suggest that the compiler you selected was somehow not installed completely.
Helo and thank you for your answer.
I am with a 32 bit matlab version. the compiler I use is :
Lcc-win32 C 2.4.1 in C:\ARCHIV~1\MATLAB\R2010a\sys\lcc Selected when I am asked for with the command mex -setup.
So I do not understand the error because if I do not introduce the MSC. ADAMS block It works properly.
Than you very much
Sorry, I'm not familiar with MSC/ADAMS. My guess is that MSC needs MS Visual Studio to be installed and selected using "mex -setup". You could consult the MSC documentation or Tech Support to verify that.
Tahnk you very much

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Simulink Coder en Centro de ayuda y File Exchange.

Preguntada:

el 28 de Sept. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by