It is possible to access bits of MATLAB\'s internal java code to programmatically change MATLAB itself. For example, you can programmatically open a document in the editor
Undocumented Matlab is a great place to start looking.