I am using MATLAB Builder NE (MATLAB.NET built-in assembly collector), but I have a problem with data types.
I put together a small, very simple function in MATLAB and built it for .NET. I can call the namespace and even the function just fine. However, my function returns a value, and MATLAB returns it by default as a data type object[]. However, I know that the value is an integer, but I cannot figure out how to distinguish it.
My MATLAB function looks like this:
function addValue = Myfunction(value1, value2)
addValue=value1+value2;
end
Pretty simple right?
And then in .NET I can name it as:
xClass.addValue (1, 3, 4);
where xClass is the name of the MATLAB built-in class, but when you try:
int x = xClass.addValue (1, 3, 4);
C # error. Typical .NET casting (int) does not work. The compiler states that it cannot convert the object [] to int.
- .NET- MATLAB, ? . MATLAB BUILDER (484 !) .