MEX: pointers to a matlab structure

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

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 28 de Ag. de 2013

1 voto

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.

Categorías

Más información sobre MATLAB Compiler SDK en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 28 de Ag. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by