CallMATLAB从Java
Call MATLAB functions and evaluate MATLAB statements from Java programs, synchronously or asynchronously. Java programs can pass data to and get data from the MATLAB workspace. The engine supports Java applications built with JDK™.For version information, seeMATLAB Interfaces to Other Languages.
To call Java functions from MATLAB, seeCall Java from MATLAB.
fonctions
Classes
rubriques
开始
- MATLAB Engine API for Java
This API enables Java programs to use MATLAB as a computational engine. - Build Java Engine Programs
Set environment variables, Java classpath, and compile and run your Java code. - Java示例源代码
These examples show how to use the MATLAB Engine API for Java.
Java引擎API概述
- Java Engine API Summary
Here is a summary of the classes and methods available to use the MATLAB Engine API for Java. - Java Data Type Conversions
MATLAB引擎API提供了将Java数据类型传递给MATLAB并将MATLAB数据类型传递给Java的映射,包括Java类,以容纳MATLAB处理对象,细胞TRSTRS,结构和复杂阵列。
UsingMATLABEngine API forJava
- 从Java开始和关闭MATLAB会话
Start the Java engine session synchronously or asynchronously and you can pass startup options to MATLAB. - Connect Java to Running MATLAB Session
Connect the Java engine to a running MATLAB session that has been started as or converted to a shared session. - 从Java执行MATLAB函数
Pass Java variables to MATLAB function calls and return values to Java. - Evaluate MATLAB Statements from Java
评估来自Java的MATLAB表达式,并将变量写入MATLAB基本工作区。 - Pass Variables from Java to MATLAB
Pass variables from Java to MATLAB as function arguments or by placing those variables in the MATLAB base workspace. - Pass Variables from MATLAB to Java
Get variables from the MATLAB workspace and map them to the appropriate Java type. - 重定向MATLAB命令窗口输出到Java
Redirect standard output from the MATLAB command window to Java.
SpecializedMATLAB类型Java
- Using Complex Variables in Java
Define complex numbers in Java using theComplex
class. - Using MATLAB Structures in Java
使用Java中定义MATLAB结构数据类型结构
class. - Pass Java CellStr to MATLAB
使用Java定义字符矢量的MATLAB单元格数组Cellstr
class. - Using MATLAB Handle Objects in Java
Return MATLAB handle objects to Java using the JavaHandleObject
class.
UsingMATLABFeatures fromJava
- 从Jav金宝appa运行Simulink模拟
您可以运行Simulin金宝appk®simulations and return results to Java.
résolutiondesproblèmes
The MATLAB Engine API for Java defines specific exception classes for MATLAB.
Pass Java Array Arguments to MATLAB
MATLAB and Java display multidimensional arrays differently, but indexed references to array elements produce the same results.
Incorrect Number of Output Arguments
If you are calling a MATLAB function with no or more than one output argument, you must provide that number in calls to the engineFeval
方法。
In certain cases, you must convert to specific MATLAB types to support the requirements of the MATLAB function you are calling.