convert a programme from matlab to C code

Hello, Does anyone can help me to solve this solution? I want to convert a programme from matlab to C code. I have already installed (MS Visual C++ 2010, and MS Windows SDK 7.1). My matlab version is 7.12.0.635 (R2011a). I have generated mex function for that matlab program. But when I convert it to C/C++ Static Library or C/C++ Executable file it shows one error: Build error: Build failed for project 'blencoder_rtw'. See the target build log for further details.
Build LOG: An installed compiler was not detected. Certain simulation modes, as well as host-based coder builds require that a compiler be installed.
Please if possible suggest me to overcome with this problem.
Manirul

Respuestas (2)

Walter Roberson
Walter Roberson el 29 de Nov. de 2013
Use
mex -setup
to configure the compiler.
Question: how have you "generated mex function for that MATLAB program" ?

3 comentarios

Mohammad Manirul
Mohammad Manirul el 30 de Nov. de 2013
Hello Walter, Now my mex -setup is working but when I try to convert matlab to c code, it shows following:
1. coder-> file.m-> MEX function-> done 2. coder-> file.m-> C/C++ static library-> done 3. coder-> file.m-> C/C++ Executable-> shows error:
file.c(25) : warning C4100: 'q' : unreferenced formal parameter file.c(25) : warning C4100: 'k' : unreferenced formal parameter file.c(25) : warning C4100: 'n' : unreferenced formal parameter
In my matlab file.m functions I have taken n,k,q as input variable.
Regards,
Manirul
Ketan
Ketan el 1 de Dic. de 2013
Hi Mohammed,
These appear to be warnings generated by the compiler while compiling the generated files. It is likely that the EXE is still being built if these are the only messages you are seeing. Here is a page that gives more info about the warning:
Those warnings would mean that you pass those parameters in but do not use them in the code. In the formal parameter list you could use ~ in place of a variable name.
function C4100(~, ~, q)

Iniciar sesión para comentar.

Andreas Goser
Andreas Goser el 29 de Nov. de 2013

0 votos

In addition to Walter's answer: What is it now about? A MEX file, a stand-alone application or C code?
For a MEX file you only need MATLAB (product wise), but stand-alone applications need the MATLAB Compiler and C code the MATLAB Coder. Please verify with "ver" what you have installed.

Categorías

Más información sobre MATLAB Compiler en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Nov. de 2013

Comentada:

el 1 de Dic. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by