From: Sergio on
Hi all,

i need to pass an array of structures declared in c++ to matlab. Is there a way to do it without passing value one by one converting them to double or else?

typedef struct
{
double lat;
double long;
char name[11] ;
} pos;


const char* fields[] = {"lat", "long", "name"};
mwArray a(1, 10, 3, fields);

for setting values, i generally use the following code
double flag = {10.0};
mwArray temp(1,1,mxDOUBLE_CLASS);
float dato;
temp.SetData(&flag,1);
a.Get("lat",1,10).Set(temp);

is there a faster way to do it? in addition, if someone can help me to set char values, cause similar method seems to fail even if i use SetCharData instead of Set.
Thx for help