Borrar filtros
Borrar filtros

MATLAB CODE TO C CODE

5 visualizaciones (últimos 30 días)
Rajesh
Rajesh el 20 de En. de 2012
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

Respuestas (6)

Walter Roberson
Walter Roberson el 23 de En. de 2012
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 comentarios
Walter Roberson
Walter Roberson el 24 de En. de 2012
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
Rajesh el 24 de En. de 2012
ya thank you, i'll try with different compiler

Iniciar sesión para comentar.


Rajesh
Rajesh el 24 de En. de 2012
mr.Walter Roberson i"m jus giving the following command after correcting the errors in my .m code.and it'll genrate the c code for me . .
codegen -c (file name).

Kaustubha Govind
Kaustubha Govind el 20 de En. de 2012
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 comentarios
Rajesh
Rajesh el 24 de En. de 2012
i'm not running any mex -setup, i'm getting my c code through the following syntax
codegen -c (my filename).
Rajesh
Rajesh el 24 de En. de 2012
sorry previously i gave wrong info , actually i have run mex-setup and i selected lcc-win 32

Iniciar sesión para comentar.


Ahmed
Ahmed el 25 de En. de 2012
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 comentario
Walter Roberson
Walter Roberson el 25 de En. de 2012
At the MATLAB command prompt, type in the command
mex -setup
and press return.

Iniciar sesión para comentar.


Ahmed
Ahmed el 29 de En. de 2012
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 comentario
Walter Roberson
Walter Roberson el 29 de En. de 2012
It seems unlikely to me that the '(' and ')' would be part of the syntax.

Iniciar sesión para comentar.


Ahmed
Ahmed el 29 de En. de 2012
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 comentarios
Walter Roberson
Walter Roberson el 29 de En. de 2012
codegen can only compile functions, not scripts. You will have to add
function NN_Modify
as the first line.
Rajesh
Rajesh el 10 de Feb. de 2012
i’m converting Matlab code to static c code, i found two ways to convert the code. Both are producing diff code, I just want to know which the correct way of code conversion. following the two commends ,
codegen -c pca
coder -new pca.prj
thanks
Rajeshkumar.c

Iniciar sesión para comentar.

Categorías

Más información sobre Dimensionality Reduction and Feature Extraction en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by