Grundlagen zur Bereitstellung
Verstehen der grundlegenden Workflows und Anforderungen zur Bereitstellung von generiertem Code
Binärdateien (Bibliotheken und ausführbare Dateien) können über die App oder über die Befehlszeile erstellt werden. Erstellen Sie implementierbaren Code mit einer Beispiel-Hauptfunktion, um die generierte Binärdatei in Ihre Anwendung zu integrieren. Ebenfalls werden unterstützende Initalisierungs- und Cleanup-Funktionen für Sie generiert. Ziehen Sie je nach den Array-Typen, die Sie in Ihren verpackten Code integrieren möchten, die folgenden Seiten zu Rate.
Funktionen
coder.ceval | Call C/C++ function from generated code |
coder.cinclude | Include header file in generated code |
packNGo | Package generated code in ZIP file for relocation |
Objekte
coder.HardwareImplementation | Hardware-specific configuration parameters for C/C++ code generation from MATLAB code |
coder.hardware | Create hardware board configuration object for C/C++ code generation from MATLAB code |
Themen
Grundlagen zur Bereitstellung
- Deploy Generated Code
Fundamental considerations for creating working binaries from generated code. - Approaches for Building Code Generated from MATLAB Code
Choose CMake or toolchain approach for building generated code. - Representation of Arrays in Generated Code
Understand how arrays are represented in the generated code. - Generating Standalone C/C++ Executables from MATLAB Code
Generate C/C++ executables at the command line or in the MATLAB® Coder™ app.
Beispiel-Hauptdatei
- Incorporate Generated Code Using an Example Main Function
MATLAB Coder generates an example main function that helps you to incorporate generated C code into your application. - Structure of Generated Example C/C++ Main Function
Examine the parts of a generated example main function so that you can modify an example main for your application.
Verwenden von generiertem Code
- Use Generated Initialize and Terminate Functions
Use supporting functions to perform initialization and cleanup operations. - Use Dynamically Allocated C Arrays in the Generated Function Interfaces
Understand and use dynamically allocated arrays from the generated C function interfaces. - Use Dynamically Allocated C++ Arrays in Generated Function Interfaces
Understand and use dynamically allocated arrays from the generated C++ function interfaces. - Package Code for Other Development Environments
Package generated files into a compressed file that you can relocate and unpack with a standard zip utility.