错误:“下标指标必须是真正的正整数或逻辑值”时,用Matlab .NET建设者 [英] Error: 'Subscript indices must either be real positive integers or logicals' when using Matlab .NET builder

查看:385
本文介绍了错误:“下标指标必须是真正的正整数或逻辑值”时,用Matlab .NET建设者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MATLAB NE生成器来编译,我从C#调用DLL文件。在MATLAB code被证实在MATLAB工作,但调用的时候从C#则出现下列错误:

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:

类型的未处理的异常'System.Exception的'中发生   MWArray.dll

An unhandled exception of type 'System.Exception' occurred in MWArray.dll

信息:

... MWMCR :: EvaluateFunction错误...标指标必须要么   是真正的正整数或逻辑值。在=> KalmanFilter.m错误的   线108。

... MWMCR::EvaluateFunction error ... Subscript indices must either be real positive integers or logicals. Error in => KalmanFilter.m at line 108.

在这行是:

plot(data(:, 1), data(:, 2));

我已经证实,当达到线,可变数据具有大小为n 4,其中n> 50,为什么该语句应该变得有意义。

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

推荐答案

据我所知,这个问题出现时,你,你函数名命名变量或为MATLAB函数(保留名称)。 确保这不会发生。

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.

这篇关于错误:“下标指标必须是真正的正整数或逻辑值”时,用Matlab .NET建设者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆