MEX: pointers to a matlab structure
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Kaustubha Govind
on 28 Aug 2013
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 Comments
See Also
Categories
Find more on MATLAB Compiler SDK in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!