以同步或异步方式从 Java 程序调用 MATLAB 函数和计算 MATLAB 语句。Java 程序可以将数据传递到 MATLAB 基础工作区，也可以从工作区获取数据。该引擎支持使用 JDK™ 7 或更高版本编译的 Java 应用程序。
要从 MATLAB 调用 Java 函数，请参阅Java 库。
|Java class to pass complex data to and from MATLAB|
|Java class to pass MATLAB struct to and from MATLAB|
|Java class to represent MATLAB cell array of char vectors|
|Java class to represent MATLAB handle objects|
Here is a summary of the classes and methods available to use the MATLAB Engine API for Java.
The MATLAB engine API provides mappings to pass Java data types to MATLAB and pass MATLAB data types to Java, including Java classes to accommodate MATLAB handle objects, cellstrs, structures, and complex arrays.
Start the Java engine session synchronously or asynchronously and you can pass startup options to MATLAB.
Connect the Java engine to a running MATLAB session that has been started as or converted to a shared session.
将 Java 变量传递给 MATLAB 函数调用，并将值返回给 Java。
Evaluate MATLAB expressions from Java and write variables into the MATLAB base workspace.
Pass variables from Java to MATLAB as function arguments or by placing those variables in the MATLAB base workspace.
Get variables from the MATLAB workspace and map them to the appropriate Java type.
Redirect standard output from the MATLAB command window to Java.
Define complex numbers in Java using the
Define MATLAB structure data types in Java using
Define a MATLAB cell array of character vectors
using the Java
Return MATLAB handle objects to Java using
You can run Simulink® simulations and return results to Java.
The MATLAB Engine API for Java defines specific exception classes for MATLAB.
MATLAB and Java display multidimensional arrays differently, but indexed references to array elements produce the same results.
If you are calling a MATLAB function with no
or more than one output argument, you must provide that number in
calls to the engine
In certain cases, you must convert to specific MATLAB types to support the requirements of the MATLAB function you are calling.