I would like to use MATLAB Coder to generate an executable (or a function in an object file) that accepts a pointer to an array as an input.
I used libpointer to create a pointer object and then tried to compile with the following codegen command:
codegen -config:lib foo -args {coder.typeof(pointer_object_name)}
The resulting error message reported that coder.typeof does not support the lipointer type.
My ultimate goal is to create something that can be called from another C function, with no MATLAB in sight, and receive a pointer to an array as an input. Can MATLAB Coder generate something like that?
@ryan-livingston asked for the signature of the function I would like MATLAB Coder to generate.
Suppose that samples is a pointer to an array of floats. I think I want MATLAB Coder to create a void foo(float *samples) that performs various computations on those floats and perhaps writes results to a file or socket.
Now that I have the attention of @ryan-livingston, I suppose I should ask the following.
- Can Coder make functions such as
resamplework with pointers? - Are pointers already being used under the hood, making my concern unnecessary?