Aufrufen von MATLAB aus C++ heraus
Die MATLAB-Engine-API für C++ bietet eine Schnittstelle zwischen der Programmiersprache C++ und MATLAB. Mit dieser API können C++ Programme MATLAB starten, MATLAB-Funktionen mit Argumenten evaluieren und Daten zwischen MATLAB und C++ Programmen austauschen. Die unterstützten Operationen sind:
Starten Sie MATLAB.
Herstellen einer Verbindung zu einer freigegebenen MATLAB-Sitzung auf der lokalen Maschine
Aufrufen von MATLAB-Funktionen mit Eingabeargumenten, die von C++ übergeben wurden, und Ausgabevariablen, die von MATLAB zurückgegeben werden
Evaluieren von MATLAB-Anweisungen im MATLAB-Basis-Workspace
Übergeben von Variablen von C++ an MATLAB und von MATLAB an C++
Informationen zum Einstieg finden Sie unter Set Up C++ Development Environment.
Die MATLAB-Engine-API für C++ nutzt MATLAB-Daten-API für C++. Dies ist eine Möglichkeit, wie Anwendungen, die außerhalb von MATLAB ausgeführt werden, über eine sprachneutrale Schnittstelle mit MATLAB-Daten arbeiten können. Die Engine-API stellt auch eine streng typisierte Schnittstelle bereit, die eine strikte Datentyp-Zuordnung zwischen MATLAB und C++ erzwingt. Diese streng typisierte Schnittstelle können Sie verwenden, um MATLAB-Funktionen und -Klassen über deren MATLAB-Namen in C++ so aufzurufen, als wären sie native C++-Funktionen und -Klassen. Ein Beispiel dazu finden Sie unter Integrate Strongly Typed MATLAB Data in C++ Application.
Klassen
Funktionen
Themen
Anforderungen
- Requirements to Build C++ Engine Applications
Install and configure a compiler and run-time environment so you can build C++ applications to call MATLAB. - Set Up C++ Development Environment
Set up a development environment to write C++ applications that call MATLAB functions.
Integrieren von MATLAB-Code in C++
- Structure of C++ Engine Applications
Get started with the MATLAB Engine API for C++. - Integrate MATLAB Function in C++ Application
Create a C++ engine application using the MATLAB Engine and Data APIs. - Integrate Strongly Typed MATLAB Data in C++ Application
Use strongly typed data with the MATLAB Engine API for C++.
Starten und Herstellen einer Verbindung zu MATLAB
- Start MATLAB Sessions from C++
How to start and connect to a MATLAB session synchronously or asynchronously from C++. - Connect C++ to Running MATLAB Session
How to connect a C++ application to a MATLAB session that was started as or converted to a shared session.
Aufrufen von MATLAB-Funktionen
- Call MATLAB Functions from C++
How to call MATLAB functions from C++, passing variables to MATLAB and returning variables to C++. - Evaluate MATLAB Statements from C++
How to evaluate MATLAB statements in your C++ program, and write variables to the MATLAB base workspace. - Pass Variables from C++ to MATLAB
How to pass variables from C++ to MATLAB as function arguments or by placing those variables directly into the MATLAB base workspace. - Pass Variables from MATLAB to C++
How to get variables from the MATLAB base or global workspace. - Redirect MATLAB Command Window Output to C++
How to redirect MATLAB Command Window output, including error messages, to your C++ program. - Convert C++ Engine Application to MATLAB Compiler SDK Application
Convert an engine application to a deployed application using MATLAB Compiler SDK™.
Verwenden von MATLAB-Datentypen in C++
- Data Type Mappings Between C++ and Strongly Typed MATLAB Code
Refer to data type mappings between C++ and MATLAB when using strongly typed MATLAB code. - Create Structure Arrays from C++
How to create structure arrays in C++ and pass them to MATLAB, or retrieve structure arrays from MATLAB. - Create Cell Arrays from C++
How to create heterogeneous arrays in C++ to use as MATLAB cell arrays. - Pass Enumerations to MATLAB from C++
How to pass members of a MATLAB enumeration class to MATLAB from C++. - Pass Sparse Arrays to MATLAB from C++
How to pass arrays from C++ to MATLAB as MATLAB sparse arrays. - Use MATLAB Handle Classes in C++
Integrate MATLAB handle classes with C++ applications. - Limitations of Strongly Typed Interface for C++
Strongly typed interface for C++ features not supported in MATLAB.