Pass array pointers in C
Show older comments
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?
Answers (1)
Kaustubha Govind
on 28 Feb 2011
0 votes
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.
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!