Hi,
To call a C++ function from MATLAB using "calllib", you need to ensure that the data types in MATLAB match those expected by the C++ function. In your case, you need to handle pointers to structures, which requires some setup in MATLAB.
- Define the structures in MATLAB using "libstruct"
- Create pointer to those structures using "libpointer"
- Now call the function with created pointers like
calllib('UDP_GigE' , 'UDP_GigE_getData' , packetType, leaderptr, payloadsptr, trailerptr, allInOneptr)
You can refer the below documentation links to know more information on "libstruct","libpointer" and for few examples: