How do you call a C# function with overloaded return arguments from MATLAB?
Afficher commentaires plus anciens
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?
Réponses (0)
Catégories
En savoir plus sur .NET Methods in MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!