It took me some time until I figured out how to pass a struct to a mex file and especially how to get out the values.
To get the values from the struct following lines are important:
/* get the values from the struct */
const mxArray *mxTmp;
mxTmp = mxGetField(prhs,0,"par1");
tmp = mxGetPr(mxTmp);
Here the full code