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

Additional information:

... 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

Answers


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.


Need Your Help

How to show the original image in galleria jquery library

jquery image jquery-ui jquery-plugins galleria

I want images to display in their original size, not stretched. How? How can I disable that.

Code coverage setup for Unit tests target

unit-testing gcc code-coverage gcov

I am facing one issue regarding code coverage setup for Unit tests. I created unit test target for my project. Generate Test Coverage Files and Instrument Program Flow i made it YES for the Unit t...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.