ERROR IN MATLAB CODER...

I´m using the MATLAB example Hello World for testing the MATLAB coder tool. (The simplest example in the MATLAB HELP), and the MATLAB give-me follow error report in the prompt window.
??? Attempted to access instrumentAndRunPos(0); index must be a positive integer or logical.
Error in ==> echodemo>formatError at 245 stackStart = max(iRet(iRet < instrumentAndRunPos(end)));
Error in ==> echodemo at 183 disp(formatError(mExc))
somebody could help me? Thanks in advance.

 Accepted Answer

Joao Paulo
Joao Paulo on 10 May 2012

0 votes

Problem solved: go to System-> Enviroment Variable-> System Variable and verify if there is in the Varible Path the following directories
%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem;%MATLAB ROOT%\runtime\win32;%MATLAB ROOT%\bin
The problem was solved after setting that.
Thanks a lot Kaustubha Govind Titus Edelhofer!

1 Comment

That's good to hear. You might mark the question as answered then ...
Titus

Sign in to comment.

More Answers (1)

Hi,
it looks as if the demo fails (and echodemo does not produce a "nice" error message). I would suggest to run the demo just as a script, i.e.,
edit coderdemo_hello_world
and then press the "run" button (or just press F5). Probably the demo will fail but should give a more helpful error message ...
Titus

5 Comments

Thank you for the help. I did the suggested,so I had the more detailed error report, but the problem persist, the error is :
link /dll /LIBPATH:"C:\PROGRA~1\MATLAB\R2011a\extern\lib\win32\microsoft" libmx.lib libmex.lib libmat.lib /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /manifest /incremental:NO /implib:"hello_world_mex.x" /MAP:"C:\Users\Joao\Desktop\Teste_geracao\coderdemo_hello_world\codegen\mex\hello_world\hello_world_mex.mexw32.map" /NODEFAULTLIB:LIBCMT /OUT:hello_world_mex.mexw32 hello_world.obj hello_world_initialize.obj hello_world_terminate.obj hello_world_api.obj hello_world_mex.obj @hello_world_mex_mex.arf
12 Creating library hello_world_mex.x and object hello_world_mex.exp
13 'cmd' nÆo ‚ reconhecido como um comando interno
14 ou externo, um programa oper vel ou um arquivo em lotes.
15 gmake: *** [hello_world_mex.mexw32] Error 1
What happens when you type "!cmd &" (without the quotes) from the MATLAB prompt?
Also, could you look at my comment on this page: http://www.mathworks.com/matlabcentral/answers/2926-convert-matlab-to-c-using-emlc-function
the DOS prompt opened and gave-me the message: "cmd is not recognized as a intern comand, batch command or a batch file"
I´m using Visual Studio, Do I have to install additionally gcc compiler to acess the gmake comand? I looked the topic which you have cited, and I searched for the system variable. There is a System Variable ComSpec which point to the path C:Windows\system32\cmd.exe .

Sign in to comment.

Categories

Products

Community Treasure Hunt

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

Start Hunting!