Tag: matlab compiler

错误:使用Matlab .NET构建器时,’下标索引必须是实数正整数或逻辑’

我正在使用matlab NE builder来编译一个我从C#调用的dll文件。 确认matlab代码在matlab中有效,但是从c#调用时会发生以下错误: MWArray.dll中发生了未处理的“System.Exception”类型exception 附加信息: … MWMCR :: EvaluateFunction error …下标索引必须是实数正整数或逻辑。 第108行的=> KalmanFilter.m出错。 有问题的行如下: plot(data(:, 1), data(:, 2)); 我已经确认,当到达该行时,变量数据的大小为n乘以4,n> 50,为什么该语句应该有意义。 有人有这方面的经验吗? 提前致谢

在MATLAB编译器生成的c#中初始化dll时出现exception

我使用MATLAB编译器生成一个带有很少MATLAB代码的.NET Assembly : function output_arg = extest( input_arg1,input_arg2 ) output_arg = input_arg1+input_arg2; end 我用向导生成了dll。 在我的Visual Studio项目中,我添加了对生成的dll( extest.dll )和MATLAB Runtime dll的引用( C:\Program Files\MATLAB\MATLAB Runtime\v92\toolbox\dotnetbuilder\bin\win64\v4.0\MWArray.dll ),如“程序集说明”中所述。 这是我的c#代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MathWorks.MATLAB.NET.Utility; using extest; namespace DllTesting { class Program { static void Main(string[] args) { ExClass e1 = new ExClass(); […]