Error: 'Subscript indices must either be real positive integers or logicals' when using Matlab .NET builder
I am using matlab NE builder to compile a dll file which I call from C#. The matlab code is confirmed to work in matlab, but when called from c# the following error occurs:
An unhandled exception of type 'System.Exception' occurred in MWArray.dll
... MWMCR::EvaluateFunction error ... Subscript indices must either be real positive integers or logicals. Error in => KalmanFilter.m at line 108.
The line in question is the following:
plot(data(:, 1), data(:, 2));
I have confirmed that when the line is reached, the variable data has size n by 4, with n > 50, why the statement is supposed to make sense.
Anyone got any experience on this? Thanks in advance
As far as I know, this issue arise when you name variables as you function names or as MatLAB functions (reserved names). Make sure this is not happening.