Call a mex file and using coder
1 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Ryan G
2012-7-31
编辑:Ryan G
2012-7-31
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.
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!