MATLAB does not run on any real-time operating systems, so the concept of real-time with MATLAB is a little shaky. You could achieve a soft real-time system however, if you're willing to live with OS-related delays and you are not acquiring/transferring data to hardware that needs to meet a strict time-table.
You've already explored MEX-files and MATLAB Compiler. One other option that I can think of is calling into MATLAB as a COM Server or using the MATLAB Engine interface, which uses COM on Windows.
Best Answer