How do you call a C# function with overloaded return arguments from MATLAB?
Show older comments
Suppose I have the following code in C#:
public class MyClass
{
public void MyFunction(out string str)
{
str = "Hello";
}
public void MyFunction(out int a)
{
a = 5;
}
}
Suppose I then want to call this function from MATLAB:
>>NET.addAssembly('MyCSharpDll.dll');
>>obj = myNamespace.MyClass();
>>number = MyFunction(obj);
The last call is ambiguous. I get this C# situation in an API from a third party. How can I tell matlab to call MyFunction with the return type I want?
Answers (0)
Categories
Find more on .NET Methods in MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!