How to call matlab generated function from c program?
1 次查看(过去 30 天)
显示 更早的评论
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!