Llamar a MATLAB desde C++
La API del motor MATLAB para C++ ofrece una interfaz entre el lenguaje de programación de C++ y MATLAB. La API permite que los programas de C++ inicien MATLAB, evalúen funciones de MATLAB con argumentos e intercambien datos con MATLAB. Las operaciones admitidas incluyen:
Iniciar MATLAB.
Conectarse a una sesión compartida de MATLAB en el equipo local.
Llamar a funciones de MATLAB con argumentos de entrada pasados desde C++ y variables de salida devueltas desde MATLAB.
Evaluar instrucciones de MATLAB en el área de trabajo básica de MATLAB.
Pasar variables desde C++ a MATLAB y desde MATLAB a C++.
Para comenzar, consulte Set Up C++ Development Environment.
Esta API del motor de MATLAB para C++ usa la API de datos de MATLAB para C++, lo que permite a las aplicaciones que se ejecutan fuera de MATLAB trabajar con los datos de MATLAB a través de una interfaz de lenguaje neutral. La API del motor también proporciona una interfaz de tipado fuerte que aplica una asignación de tipo de datos estricta entre MATLAB y C++. Puede utilizar esta interfaz de tipado fuerte para llamar a funciones y clases de MATLAB por sus nombres de MATLAB en C++ como si fueran funciones y clases de C++ nativas. Para ver un ejemplo, consulte Integrate Strongly Typed MATLAB Data in C++ Application.
Clases
Funciones
Temas
Requisitos
- 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.
Integrar código de MATLAB en 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++.
Iniciar MATLAB y conectarse a la plataforma
- 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.
Llamar a funciones de MATLAB
- 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™.
Utilizar tipos de datos de MATLAB en 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.