How to call matlab generated function from c program?
1 回表示 (過去 30 日間)
古いコメントを表示
Nanda Thanigaivelan
2020 年 12 月 15 日
コメント済み: Nanda Thanigaivelan
2020 年 12 月 17 日
Hi,
I am new to Matlab coder and would like to use generated functions in a project. I wrote few function implementations, say
objects = fuse_detections(frame_r, frame_c, ldr, ts)
in matlab and generated c code using Matlab coder. C code for the function implementations are generated successfully. I want to call the generated functions, by passing arguments and get values, from an other c program (which is a normal c program). I am aware that I should link generated object files (.o files) with the c program in order to use those functions. I did link .o files and .c files using ninja. How do I call those generated functions from my c program?
0 件のコメント
採用された回答
Darshan Ramakant Bhat
2020 年 12 月 15 日
You have to include the appropriate header files which contains the generated function declaration. Then you can directly call those functions from your other C/C++ coder. While compiling the entire application, you need to link the library appropriately.
Below document explains how to use the generated dll in Visual Studio and how to call it in a new C/C++ coder :
You can also generate a sample example main file and take a look at it on how to use the generated functions :
Hope this will be helpful
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!