Java Example Source Code
The MATLAB® engine API for Java® ships with example
code that you can use to test your environment and to become familiar
with the use of the engine API. The Java source code is located
the path returned by the MATLAB
The folder contains these files:
EngineGUIDemo.java— A Swing-based user interface that accepts an input number and uses MATLAB to calculate the factorial of the number.
EngineConsoleDemo.java— A Java program that uses MATLAB logical indexing and mathematical functions to operate on a numeric matrix.
README— A text file that describes how to build and run the examples.
To build these examples, first copy the files to a writable
folder on your path. You can use the MATLAB
copyfile function for this purpose:
Follow the instructions in the
to compile and run the examples.