Clear Filters
Clear Filters

Converting MATLAB Class to DLL for Use in Visual Studio 2019

4 views (last 30 days)
I have completed defining subclasses and parent classes in MATLAB. The member variables of the subclass are complex structures with nested structures. The values of these member variables are obtained by calling external functions or other member functions within the class. I encapsulated the subclass into an entry function to convert it into a DLL. The input parameters of the function are passed to the constructor of the subclass, resulting in an instantiated object of the subclass. By referencing different member variables and their fields within the instantiated object, I can obtain the required values.
Now I need to use the Library Compiler to generate a DLL function for the encapsulated entry function so that I can continue development in Visual Studio 2019. Should I generate a "C shared library" or a "C++ shared library"? What type should I use to handle the return values of the DLL functions, mxArray or mwArray? How can I further process these types of return values in Visual Studio 2019 C/C++ to obtain the fields and values within the structures?

Answers (0)

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!