I’m currently using Matlab to import a custom dot NET dll library I have,
using AssemblyInfo = NET.addAssembly('c:\myClasses.dll').
listing disp(AssemblyInfo.Classes) expose the custom classes of the library, like
'MyLib.ClassA'
'MyLib.ClassB'
'MyLib.ClassA+eResults'
I’m using myVar = MyLib.ClassA; to create a .net class variable within matlab (which works fine),
but the second class has no constructor, so myVar = MyLib.ClassB; results in
No constructor 'MyLib.ClassB' with matching signature found.
The second issue is the plus sign (+) at the .NET class MyLib.ClassA+eResults,
of which causing an error when I try myVar = MyLib.ClassA+eResults;
Undefined function or variable 'eResults'.
Is there a way to create an instance custom class MyLib.ClassB within matlab?
What is the plus sign means, and how do I create an instance of MyLib.ClassA+eResults without any syntax error?
To create an instance of a class, it must be public and have public constructors. If the classB has only a custom constructor with multiple parameters, you can instantiate it like this:
for the second issue, the + means eResults is a nested class of ClassA. You can’t instantiante directly, but there is a workaround based on reflection described here: Working With Nested Classes: