Borrar filtros
Borrar filtros

Call a mex file and using coder

1 visualización (últimos 30 días)
Michael
Michael el 31 de Jul. de 2012
I have some legacy Matlab code which makes a call to a mex file, call it get_score. The mex file was written in C. This Matlab code was then compiled to C using the mcc command. This was all done on an older version of Matlab.
We are now upgrading to the latest version of Matlab so I will be using Matlab Coder to generate C code from our Matlab code. What is the correct way to call the get_score mex file? I tried running mex on the c code and generating a new mexw32 file and calling that but when I attempt to run coder I get the error Unsupported file extension 'mexw32'.
Is the proper way to do this just compile the C code to a standard dll using, say Visual Studio, and then call the dll using coder.ceval?

Respuesta aceptada

Ryan G
Ryan G el 31 de Jul. de 2012
Editada: Ryan G el 31 de Jul. de 2012
The thing about mex files is they require MATLAB to run (MATLAB executable). MATLAB coder can generate more generic c-code that can be utilized independent of MATLAB so if you try to call a mex-file from this code you may run into issues.
It sounds like you already know what to do and you can use the ceval command directly on the C-code that the mex file utilizes.
  1 comentario
Michael
Michael el 31 de Jul. de 2012
Thanks Ryan, it seemed like that was what I wanted but I'm new to Matlab so just wanted to be sure

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB Coder 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