MATLAB: Do I get System.Arg​umentOutOf​RangeExcep​tion with UINT16 data types in .NET

intMATLAB Compileruintunsigned

I have created a .NET assembly of the following:
function sample_data = samplefunction
sample_data = uint16(5639*ones(20,60));
Next, I try to use the generated component in a C# console project as follows:
SanpleProj.SampleFunctionClass obj = new SampleProj.SampleFunctionClass();
try
{
MWArray argsOut = null;
argsOut = obj.samplefunction();
Console.WriteLine("Arg 1: {0}", argsOut);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
I get the following exception in Visual Studio:
Exception of type 'System.ArgumentOutOfRangeException' was thrown.
Parameter name: numArgsOut

Best Answer

MATLAB Builder NE Version 3.0.2 (R2009b) does not support UINT16 data types. To view other unsupported data types, run the following command in MATLAB 7.9 (R2009b):
web([docroot '/toolbox/dotnetbuilder/ug/bqha7oi-1.html#bp_uwkv-3'])
As a workaround, use a supported data type such as double.