Nutzung einer vorhandenen MATLAB-Schnittstelle zu einer C++ Bibliothek
Um eine Funktion in einer C++ Bibliothek aufzurufen, verwenden Sie den Namespace MATLAB®
clib
Wenn Sie über eine veröffentlichte MATLAB-Schnittstelle zu einer freigegebenen C++ Bibliothek verfügen, dann können Sie diese Klassen und Funktionen direkt in MATLAB nutzen und Daten zwischen MATLAB und C++ übertragen.
Funktionen
clibArray | Create MATLAB clib array for C++ library functions |
clibConvertArray | Convert MATLAB fundamental or struct array to MATLAB array of C++ objects |
clibConfiguration | Set run-time configuration parameters for C++ library interface (Seit R2023a) |
CLibraryConfiguration | C++ library interface environment information (Seit R2023a) |
clibIsNull | Determine if C++ object is null |
clibIsReadOnly | Determine if C++ object is read-only |
clibRelease | Release C++ object from MATLAB |
underlyingValue | Underlying numeric value for C++ enumeration object created in MATLAB |
Themen
Konfigurieren der C++-Bibliotheksschnittstelle
- Set Run-Time Library Path for C++ Interface
If the C++ library has a compiled library file, then that file and its dependencies must be on your system path or run-time search path (rpath). - Load C++ Library In-Process or Out-of-Process
Execute C++ functions in processes that are the same as or separate from the MATLAB process. - Display Help for MATLAB Interface to C++ Library
Display information about the members of MATLAB interface.
Verwenden der C++ Bibliothek in MATLAB
- Call Functions in C++ Compiled Library
To call a function in the library, use the MATLAB
clib
namespace. - Pass clib.array to C++ Functions
The term clib array is the MATLAB object representation of C++ native arrays andstd::vector
types. - Create MATLAB Array of C++ Objects
CallclibArray
to create MATLAB clib array for C++ library functions. - MATLAB Type to C++ Type Mapping
When you pass MATLAB data as arguments to C++ methods or functions, MATLAB converts the data into types that best represent the data to the C++ language. - C++ Names That Are Invalid in MATLAB
How MATLAB handles C++ names that are invalid MATLAB names. - Use C++ Objects and Functions in parfor Loops
How to take advantage of parallel computing resources using a MATLAB interface to a C++ compiled library.
Fehlersuche
Troubleshooting MATLAB Interface to C++ Library Run-Time Issues
Resolve unexpected run-time errors when calling functions in a published MATLAB interface to a C++ shared library.
Troubleshooting Calls to C++ Library Functions
Resolve unexpected issues when calling functions in a C++ shared library.
C/C++ library features not supported in MATLAB.
Using C++ exceptions in MATLAB.