Calling a C function from a .m file
4 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to make a Matlab function that will call a C function and send and receive data from that C function. Basically I'm looking for the equivalent of MexCallMATLAB to write in a .m file.
All help is appreciated.
0 件のコメント
回答 (2 件)
Rick Rosson
2011 年 6 月 24 日
If you own MATLAB Coder (R2011a) or Real-Time Workshop (R2010b or earlier), you can use coder.ceval (MATLAB Coder) or eml.ceval (Real-Time Workshop), and then automatically generate a MEX-Function from the MATLAB code.
2 件のコメント
Walter Roberson
2011 年 6 月 24 日
Would that be appropriate for the case where someone has an existing C function that they want to call from MATLAB ?
Rick Rosson
2011 年 6 月 25 日
Yes. Please see the following example:
http://www.mathworks.com/matlabcentral/fileexchange/21805
Walter Roberson
2011 年 6 月 24 日
calllib() might be the closest to that. Sometimes, though, it is easier to write an MEX interface to the routine.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Code Analysis についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!