clibPublishInterfaceWorkflow
R2026bCreate live script to publish platform-specific interface for C/C++ library
Since R2023a
Description
If you have a C or C++ shared library that exports functionality that can be called from another application, then you can use those classes and functions directly in MATLAB®. To get started, you must first build an interface to the library to use to call the functionality in MATLAB. Someone who creates this interface is called a publisher. You can package the interface and share it with a MATLAB end user. For information about calling these C/C++ functions from MATLAB, see Use Prebuilt MATLAB Interface to C/C++ Library.
clibPublishInterfaceWorkflow creates a template live script that
you can use as a starting point to publish a MATLAB interface to a C/C++ library. The generated script can be modified or reused
to support automated or iterative interface definition workflows. Use this script to:
Generate the interface definition object, for example, using the Generate C++ Interface task.
Define missing functionality by updating the interface definition object in the script.
Build the MATLAB interface to the C/C++ library file from the interface definition.
Test the interface by setting up run-time libraries and calling library functions.
Use clibPublishInterfaceWorkflow to publish an interface for your
current platform. To support multiple platforms, reuse or adapt the generated script for
each platform by running the published script on the specific platform.
For more information, see How to Publish a MATLAB Interface to a C/C++ Library.
Examples
Alternative Functionality
Publish at Command Line
You can also create and customize interface definitions programmatically without using a live script.