passing a structure pointer from C mex file to matlab
7 次查看(过去 30 天)
显示 更早的评论
Hi,
I m trying to pass a pointer of a static structure from C mex to matlab, this pointer will be used by another C mex function. any help will be much appreciated thanks in advance
0 个评论
采纳的回答
James Tursa
2017-3-14
The usual hack is to encapsulate the pointer in a MATLAB uint64 variable. I.e., set the data area of a uint64 mxArray to the value of your pointer and pass that variable around. However, you need to be careful that the pointer is indeed valid to use in that other mex routine or it will cause a MATLAB crash.
3 个评论
James Tursa
2017-3-15
See this link:
https://www.mathworks.com/matlabcentral/answers/75524-returning-and-passing-void-pointers-to-mex-functions?s_tid=answers_rc1-2_p2_MLT
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!