필터 지우기
필터 지우기

Converting mxArrays to libpointer in MATLAB block

조회 수: 1 (최근 30일)
Arun
Arun 2013년 8월 6일
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?

채택된 답변

Kaustubha Govind
Kaustubha Govind 2013년 8월 9일
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
Arun
Arun 2013년 8월 9일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by