Main Content

Java パッケージの統合

コンパイルされた MATLAB® 関数を Java® アプリケーションに統合する

MATLAB Compiler SDK™ では、コンパイルされた MATLAB 関数を Java アプリケーションと統合するにあたり、MATLAB Runtime の初期化、コンパイルされた MATLAB 関数の MATLAB Runtime への読み込み、および Java と MATLAB 間で渡されるデータの管理を行う API を組み合わせて使用します。

Java のパッケージとアプリケーションは、大規模なエンタープライズ環境や Web 環境のアプリケーションに対し、移植可能でスケーラブルなソリューションを提供します。生成されたパッケージは、MATLAB Runtime がインストールされているエンタープライズ環境や Web 環境にデプロイできます。

Java Remote Method Invocation (RMI) は、Java オブジェクトによって別の Java 仮想マシン (JVM) のオブジェクトを呼び出せるようにする API のセットです。RMI を使用して、クライアント/サーバー アプリケーション、分散アプリケーション、および Web アプリケーションを開発します。このようなアプリケーションでは、MATLAB 関数を直接呼び出すアプリケーションの部分にのみ MATLAB Runtime が必要です。アプリケーションの他の部分は、ネイティブな Java データ型で操作できます。

関数

compiler.build.javaPackageMATLAB の外部でデプロイする Java パッケージの作成 (R2021a 以降)
compiler.build.JavaPackageOptionsJava パッケージのビルド オプション (R2021a 以降)
compiler.build.Resultsコンパイラ ビルド結果オブジェクト (R2020b 以降)
mcrinstaller現在のプラットフォームに対応する MATLAB Runtime インストーラーのバージョンと場所の情報を表示
mcrversionMATLAB のバージョンに対応する MATLAB Runtime のバージョン番号を返す

Java API ドキュメンテーション

クラス

すべて展開する

com.mathworks.extern.java.MWArray Abstract Java base class to manage array types in MATLAB
com.mathworks.extern.java.MWCellArray Java class to manage MATLAB cell arrays

データ型表現

com.mathworks.toolbox.javabuilder.MWArray Java class to serve as base for all MATLAB array types with native array handling
com.mathworks.toolbox.javabuilder.MWCellArray Java class to manage MATLAB cell arrays
com.mathworks.toolbox.javabuilder.MWCharArray Java class to manage MATLAB character arrays
com.mathworks.toolbox.javabuilder.MWNumericArray Java class to manage numeric arrays in MATLAB
com.mathworks.toolbox.javabuilder.MWStringArray Java class to manage MATLAB string arrays
com.mathworks.toolbox.javabuilder.MWStructArray Java class to manage MATLAB struct arrays
com.mathworks.toolbox.javabuilder.MWLogicalArray Java class to manage MATLAB logical arrays
com.mathworks.toolbox.javabuilder.MWComplexity Java class to enumerate MATLAB array complexity properties
com.mathworks.toolbox.javabuilder.MWFunctionHandle Java class to represent function handles in MATLAB
com.mathworks.toolbox.javabuilder.MWClassID Java class to enumerate all MATLAB array types

MATLAB Runtime の管理

com.mathworks.toolbox.javabuilder.MWApplication Java class to initialize and manage MATLAB Runtime global state
com.mathworks.toolbox.javabuilder.MWMCROption Java class to specify MATLAB Runtime initialization options

コード アーカイブ (.ctf ファイル) の管理

com.mathworks.toolbox.javabuilder.MWCtfClassLoaderSource Java class to manage code archive (.ctf file) sources from class loader in MATLAB
com.mathworks.toolbox.javabuilder.MWCtfExtractLocation Java class to manage code archive (.ctf file) extraction locations in MATLAB
com.mathworks.toolbox.javabuilder.MWCtfFileSource Java class to handle code archive (.ctf file) file sources in MATLAB
com.mathworks.toolbox.javabuilder.MWCtfSource Java interface to interact with code archive (.ctf file) sources in MATLAB
com.mathworks.toolbox.javabuilder.MWCtfStreamSource Java class to manage code archive (.ctf file) stream sources in MATLAB

その他

com.mathworks.toolbox.javabuilder.Images Java utility methods for image data manipulation within MWArrays
com.mathworks.toolbox.javabuilder.MWComponentOptions Java class to manage component instance options in MATLAB
com.mathworks.toolbox.javabuilder.MWJavaObjectRef Java class to create a MATLAB array that references aJava object
com.mathworks.toolbox.javabuilder.MWMatrixRef Java class to represent matrix references in MATLAB

インターフェイス

Interface Disposable Java interface for releasing native resources used by classes
Interface MWComponentOption Java interface for component initialization options

例外

com.mathworks.toolbox.javabuilder.MWException Java class to handle exceptions in MATLAB Compiler generated artifacts

リモート処理クラス

com.mathworks.toolbox.javabuilder.remoting.AbstractMWArrayVisitor<T> Abstract Java class to provide visitor pattern for array types
com.mathworks.toolbox.javabuilder.remoting.BasicRemoteFactory Java class to implement RemoteFactory interface
com.mathworks.toolbox.javabuilder.remoting.NativeArrayContainer Java class to ensure proper disposal of automatically created arrays in remote proxies
com.mathworks.toolbox.javabuilder.remoting.RemoteProxy Java class to dynamically generate remote proxies for local object access via RMI

インターフェイス

Interface DisposeListener Java interface for listening to remote proxy object disposal
Interface MWArrayVisitor<T> Java interface to define array visitor behavior
Interface RemoteFactory Java interface to factory for remote proxy objects

トピック

要件とハイライト

作成および Java との統合

サンプル アプリケーション

データ管理

デプロイについての考慮事項

Remote Method Invocation

Java パッケージのトラブルシューティング