Mex file from multiple sources
7 ビュー (過去 30 日間)
古いコメントを表示
I have two C codes. First one is the main code and the second one is for the initial arrangements, the calling of the main code and printing of the results. I want to convert this to mex file and access it from MATLAB. How should I convert them so that I can access to both functions?
Thanks.
0 件のコメント
回答 (1 件)
Jan
2017 年 2 月 23 日
You can compile them together:
mex -O main.c printing.c
Then you can access the main function only. Either you include a wrapper in the mexFunction(), which forward calls to the subfunctions e.g. triggered by the first input. Or you compile two functions:
mex -O main.c
mex -O printing.c
Then you can call the printing lib directly from Matlab or through mexCallMATLAB from the main.mex function. There is an undocumented function mexRunMexFile also, but I'd hesitate to use it.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!