Filter löschen
Filter löschen

Converting mxArrays to libpointer in MATLAB block

1 Ansicht (letzte 30 Tage)
Arun
Arun am 6 Aug. 2013
I have an extrinsic function - foo(), with a prototype similar to below:-
[uint32, voidPtr, uint32Ptr] = foo(voidPtr, uint32Ptr);
I have created a uint32 pointer using libpointer and passed it to the calllib function call of foo(). Now code generation causes these types to be converted to mxArrays. So to convert these mxArrays to known types, we assign them to pre-defined variables of the desired type. But for me, the desired type is uint32Ptr. How do I pre-define a variable of type uint32Ptr as the result of libpointer is also an mxArray? Or, is there a way to declare a variable of type uint32?

Akzeptierte Antwort

Kaustubha Govind
Kaustubha Govind am 9 Aug. 2013
I would recommend that you move all creation/extraction of libpointers also inside an extrinsic function, and have only builtin (MATLAB) types at the interface, so that you can pre-define them appropriately in your top-level function.
  1 Kommentar
Arun
Arun am 9 Aug. 2013
That is what I did initially - call a MATLAB function to extract pointer data. Thought there might be a prettier work-around to the problem! Thanks for the reply.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by