MATLAB CODE TO C CODE
이전 댓글 표시
Hi Frnds, i coverted the matlab code to c code using codgen ,while i'm running the code in turbo c i'm facing the problem. its showing 25 errors, most of them showing as decleration syntax error. pls help me out thank you
답변 (6개)
Walter Roberson
2012년 1월 23일
1 개 추천
According to one of your other posts, you are using R2011a. Turbo C is not a supported compiler for R2011a. See http://www.mathworks.com/support/compilers/R2011a/win32.html
댓글 수: 5
Rajesh
2012년 1월 24일
Walter Roberson
2012년 1월 24일
Have you run through an example such as is described at http://www.mathworks.com/help/toolbox/coder/gs/bsumqa0.html in order to verify that the basics work for you?
Perhaps you could describe more specifically the errors that you see when you use Turbo C.
Rajesh
2012년 1월 24일
Walter Roberson
2012년 1월 24일
That those are valid declaration syntax in C99, but I do not recall for certain whether they were valid in C89. I do find a number of locations that indicate that Turbo C was C89 at most (and possibly not even all of that), indicating that you will probably need to find a later compiler.
What is your target system that you are compiling for (that the code will be run on)? If it is MS Windows then use one of the compilers listed in the link I gave above.
Rajesh
2012년 1월 24일
Kaustubha Govind
2012년 1월 20일
0 개 추천
Perhaps you are not specifying the correct compiler options? Make sure to use the codegen -v (verbose) option to see the exact compiler/linker commands that need to be used.
댓글 수: 4
Rajesh
2012년 1월 23일
Kaustubha Govind
2012년 1월 23일
Have you run "mex -setup"? What compiler did you choose?
Rajesh
2012년 1월 24일
Rajesh
2012년 1월 24일
Ahmed
2012년 1월 25일
0 개 추천
Dear Rajesh
I have the same problem but when I used you command the following error appeared:
Could not locate the MEX compiler options file mexopts.bat. Run mex -setup to select the MEX compiler and create the MEX options file. Use help codegen for more information on using this command. Error using codegen
How to run mex -setup??
댓글 수: 1
Walter Roberson
2012년 1월 25일
At the MATLAB command prompt, type in the command
mex -setup
and press return.
Ahmed
2012년 1월 29일
0 개 추천
Dear Rajesh
I have the following error after writing the command codegen -c (NN_modify)
??? Unable to locate function '(NN_modify)'.
Code generation failed: Open error report. Error using codegen
I don't have any functions in my code
댓글 수: 1
Walter Roberson
2012년 1월 29일
It seems unlikely to me that the '(' and ')' would be part of the syntax.
Ahmed
2012년 1월 29일
0 개 추천
Dear Walter
In my code I'm using the following lines:
load('input.mat');
load('target.mat');
after correcting the command line as you recommended, errors changed to:
??? This text contains non-empty top-level expressions. It appears to be a script.
Error in ==> NN_modify Line: 1 Column: 1
Code generation failed: Open error report.
Error using codegen
댓글 수: 2
Walter Roberson
2012년 1월 29일
codegen can only compile functions, not scripts. You will have to add
function NN_Modify
as the first line.
Rajesh
2012년 2월 10일
카테고리
도움말 센터 및 File Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!