Question: 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 using

```
editorServices = com.mathworks.mlservices.MLEditorServices;
editorServices.newDocument()  %older versions of MATLAB seem to use new()

```

You can see the method signatures (but not what they do) using `methodsview`.

```
methodsview(com.mathworks.mlservices.MLEditorServices)

```

I have a few related questions about using these Java methods.

Firstly, is there any documentation on these things (either from the Mathworks or otherwise)?

Secondly, how do you find out what methods are available? The ones I've come across appear to be contained in JAR files in matlabroot\java\jar, but I'm not sure what the best way to inspect a JAR file is.

Thirdly, are there functions for inspecting the classes, other than `methodsview`?

Finally, are there any really useful methods that anyone has found?

Answer: 
There is no official documentation nor support for these classes. Moreover, these classes and internal methods represent internal implementation that may change without notice in any future Matlab release. This said, you can use my [uiinspect](http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-methodspropertiescallbacks-of-an-object) and [checkClass](http://www.mathworks.com/matlabcentral/fileexchange/26947-checkclass) utilities to investigate the internal methods, properties and static fields. These utilities use Java reflection to do their job, something which is also done by the built-in ***methodsview*** function (I believe my utilities are far more powerful, though). In this respect, I believe we are not crossing the line of reverse-engineering which may violate Matlab's license.

If you are looking for documentation, then my [UndocumentedMatlab.com](http://UndocumentedMatlab.com) website has plenty of relevant resources, and more is added on a regular basis so keep tuned.

I am also working on a book that will present a very detailed overview of all these internal classes, among other undocumented stuff - I hope to have publication news later this year.
[Undocumented Matlab](http://undocumentedmatlab.com/) is a great place to start looking.