Pass array pointers in C
显示 更早的评论
I have a MATLAB function y=foo(u, D) where y, u, and D are arrays. I used emlc to create a library of this function. When writing my main.c, how can I pass my array pointers to the function?
回答(1 个)
Kaustubha Govind
2011-2-28
0 个投票
You should be able to pass in numeric array pointers directly (just like you would with any other C shared library). Look at the function prototype in the generated header file, and pass in arguments appropriately. See Calling Generated C/C++ Functions for a simple example with a scalar input. If you need more help, please post the function prototypes for the generated library's entry points.
类别
在 帮助中心 和 File Exchange 中查找有关 C Shared Library Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!