Build a .NET Application for MATLAB Examples
You can use C# code examples in MATLAB®, such as the NetDocCell
assembly provided in Convert .NET Arrays to Cell Arrays.
Build an application using a C# development tool, like Microsoft®
Visual Studio® and then load it into MATLAB using the NET.addAssembly
function. The following are
basic steps for building; consult your development tool documentation for specific
instructions.
From your development tool, open a new project and create a C# class library.
Copy the classes and other constructs from the C# files into your project.
Build the project as a
DLL
.The name of this assembly is the namespace. Note the full path to the DLL file. Since it is a private assembly, you must use the full path to load it in MATLAB.
After you load the assembly, if you modify and rebuild it, you must restart MATLAB to access the new assembly. You cannot unload an assembly in MATLAB.