This can be realized by MATALB C API function "mxGetField"
#if !defined(_WIN32)
#define dgesv dgesv_
#endif
#include "mex.h"
#include"matrix.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
if (mxIsStruct(prhs[0]))
{
double *pointer, *pointerrhs;
mxArray *StructValue = mxGetField(prhs[0], 0, "a");
plhs[0] = mxCreateNumericMatrix(1, 1, mxDOUBLE_CLASS, mxREAL);
pointer = mxGetPr(plhs[0]);
pointer[0] = *(mxGetPr(StructValue));
}
else
{
mexErrMsgTxt("The Input is Not a Struct");
}
}