Error: 'Subscript indices must either be real positive integers or logicals' when using Matlab .NET builder

旧街凉风 提交于 2019-12-23 19:25:40

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/14474797/error-subscript-indices-must-either-be-real-positive-integers-or-logicals-whe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!