フィルターのクリア

Call a mex file and using coder

1 回表示 (過去 30 日間)
Michael
Michael 2012 年 7 月 31 日
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?

採用された回答

Ryan G
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.
  1 件のコメント
Michael
Michael 2012 年 7 月 31 日
Thanks Ryan, it seemed like that was what I wanted but I'm new to Matlab so just wanted to be sure

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by