Hi Peter,
When integrating C++ libraries with MATLAB, particularly those utilizing features not directly supported by MATLAB's C interface (such as operator overloading), creating a wrapper around the C++ code is a common and effective strategy. This wrapper translates the C++ classes and their operations into functions that can be called from MATLAB, effectively exposing the C++ library's functionality in a way that MATLAB can interact with.
1. Create Wrapper Functions - For each overloaded operator in your C++ class, create a corresponding wrapper function. This function will explicitly call the operator and provide a way to invoke it from MATLAB.
2. Expose the Wrapper Functions to MATLAB - After creating wrapper functions, you need to expose them to MATLAB. This involves declaring them in a way that MATLAB's C interface can interact with, typically through a DLL (Dynamic Link Library) on Windows.You'll compile your C++ code along with the wrapper functions into a DLL.
3. Call the Wrapper Functions from MATLAB.
Hope this helps.