I think using coder.ceval is the right way to do this. Also, coder.ceval can return arrays/matrices. You just need to pre-allocate the return value so that it knows that type to expect. I haven't tried this before though, so please post back if you run into specific issues.
coder.ceval does indeed return only scalar values as mentioned in the documentation. I was able to generate code for this operation using this MATLAB code:
function X = testReadMAT()
X = 0;
SS_Table_file = coder.opaque('MATFile *');
SS_Table_file = coder.ceval('matOpen','datatable.mat','r');
Xp = coder.opaque('mxArray *');
Xp = coder.ceval('matGetVariable',SS_Table_file,'X');
X = coder.ceval('mxGetPr',Xp);
>> codegen -c -config:exe testReadMAT.m
There is still work to be done to build the code against the MAT-file API however.