Main Content

C 共有ライブラリの統合

パッケージ化された MATLAB® 関数を C アプリケーションに統合する

MATLAB Compiler SDK™ では、MATLAB 関数から C 共有ライブラリを作成することができます。

mxArray API を使用する共有ライブラリのインターフェイスは、C スタイルの関数を使用して MATLAB Runtime の初期化、パッケージ化された MATLAB 関数の MATLAB Runtime への読み込み、および C コードと MATLAB Runtime の間で渡されるデータの管理を行います。例については、Implement a C Shared Library with a Driver Applicationを参照してください。


mbuildCompile and link source files against MATLAB generated shared libraries


mclmcrInitializeInitialize the MATLAB Runtime proxy library
mclInitializeApplicationSet up application state shared by all MATLAB Runtime instances created in current process
mclTerminateApplicationClose MATLAB Runtime-internal application state
<library>Initialize[WithHandlers]Initialize MATLAB Runtime instance associated with library
<library>TerminateFree all resources allocated by MATLAB Runtime instance associated with library
mclRunMainMechanism for creating identical wrapper code across all platforms
mclIsMCRInitializedDetermine if MATLAB Runtime has been properly initialized
mclWaitForFiguresToDieEnable deployed applications to process graphics events, enabling figure windows to remain displayed
mclGetLastErrorMessageLast error message from unsuccessful function call
mclGetLogFileNameRetrieve name of log file used by MATLAB Runtime
mclIsJVMEnabledDetermine if MATLAB Runtime was started with instance of Java Virtual Machine (JVM)
mclIsNoDisplaySetDetermine if -nodisplay mode is enabled


C 共有ライブラリの作成と実装

MATLAB コードによる C 共有ライブラリの作成

C 共有ライブラリを作成する方法を学習する。

Create C/C++ Shared Libraries from Command Line

Use the command-line compiler to create C/C++ shared libraries.

Implement a C Shared Library with a Driver Application

Call a C shared library built with MATLAB Compiler SDK from a C driver application.

C 共有ライブラリと C ドライバー アプリケーションの統合

Call a C Shared Library

Use one or more MATLAB Compiler SDK generated C shared libraries in your C application.

Call MATLAB Compiler SDK API Functions from C/C++

Use MATLAB Compiler SDK API functions for C/C++ to assimilate shared libraries in driver code.

Compile and Test a MATLAB Generated C Shared Library

Compile the C driver code and shared libraries, and test the C application.

Use Multiple Shared Libraries in Single Application

Use multiple generated shared libraries in a single C/C++ application.

Mac OS X

Write Applications for macOS

Write deployable C++ applications specifically for macOS.

MATLAB Runtime の設定

MATLAB Runtime Path Settings for Development and Testing

Path settings to develop and test applications containing packaged MATLAB code.

MATLAB Runtime Startup Options

Set MATLAB Runtime options, such as -nojvm, -nodisplay, or -logfile.

MATLAB Runtime Component Cache and Deployable Archive Embedding

Override the default archive embedding behavior, and use MATLAB Runtime component cache.