MEX: pointers to a matlab structure
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I have the following problem. There is a Matlab structure as follows:
d(1).x=uint32([1 4 6 7 ]);
d(1).y=single([3.3 2.5 3.5 4.4]);
d(2).x=uint32([6 1 7 ]);
d(2).y=single([2.5 3.8 4.4]);
....
d(n).x=uint32(...
d(n).y=single(...
The structure "d" is huge (40GB). I need to do some fast calculation with it. How can I get pointers e.g. d(2).x(3) and d(2).y(3) in MEX?
PETR
0 件のコメント
回答 (1 件)
Kaustubha Govind
2013 年 8 月 28 日
You need to use mxGetField to access structure fields and mxGetData to access data in a numeric array. If you'd like to see an example, I'd recommend $matlab/extern/examples/refbook/phonebook.c (where $matlab is the location of your MATLAB installation). There are other examples for the MEX API in the same directory.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler SDK についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!