C# MWArray[] as function return type in .NET Assembly

1 view (last 30 days)
Hi, I implemented a sample function
function [structout, numout, strout] = mydifftypes(str,struct,num)
structout.num = num;
structout.str = str;
structout.struct = struct;
numout = num + 10;
strout = [str 'abc'];
and use the deploytool to build the .Net assembly. When I explore the generated assembly source C# code I can see that the function is overloaded:
public MWArray mydifftypes()
{
return mcr.EvaluateFunction("mydifftypes", new MWArray[]{});
}
public MWArray mydifftypes(MWArray str)
{
return mcr.EvaluateFunction("mydifftypes", str);
}
public MWArray mydifftypes(MWArray str, MWArray struct0)
{
return mcr.EvaluateFunction("mydifftypes", str, struct0);
}
public MWArray mydifftypes(MWArray str, MWArray struct0, MWArray num)
{
return mcr.EvaluateFunction("mydifftypes", str, struct0, num);
}
public MWArray[] mydifftypes(int numArgsOut)
{
return mcr.EvaluateFunction(numArgsOut, "mydifftypes", new MWArray[]{});
}
public MWArray[] mydifftypes(int numArgsOut, MWArray str)
{
return mcr.EvaluateFunction(numArgsOut, "mydifftypes", str);
}
public MWArray[] mydifftypes(int numArgsOut, MWArray str, MWArray struct0)
{
return mcr.EvaluateFunction(numArgsOut, "mydifftypes", str, struct0);
}
public MWArray[] mydifftypes(int numArgsOut, MWArray str, MWArray struct0, MWArray
num)
{
return mcr.EvaluateFunction(numArgsOut, "mydifftypes", str, struct0, num);
}
public void mydifftypes(int numArgsOut, ref MWArray[] argsOut, MWArray[] argsIn)
{
mcr.EvaluateFunction("mydifftypes", numArgsOut, ref argsOut, argsIn);
}
I have a few questions: a) How to determine which assembly function to use ? b) I would like to read the assembly function IO parameters names and types. It can be done by using .Net Reflection library. I can simple get the function input parameter names and types however the output parameters are (in the sample case structout, numout, strout) are defined as return type MWArray[]. I would like to know if it is posible to get the output names from this return type somehow ....

Answers (0)

Community Treasure Hunt

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

Start Hunting!