问题遇到的现象和发生背景
C#调用matlab里的LSSvm相关的函数。将函数打包后调用出现如下问题
遇到的现象和发生背景,请写出第一个错误信息
$exception {"\n\n... MWMCR::EvaluateFunction error ... \n未定义与 'struct' 类型的输入参数相对应的函数 'crossvalidatelssvm'。\nError in => MyIssvm.m at line 46.\n\n... Matlab M-code Stack Trace ...\n at\nfile C:\\Users\\PC\\AppData\\Local\\Temp\\PC\\mcrCache9.11\\MyIssv1\\MyIssvm\\tunelssvm.m, name simanncostfun2, line 485.\n at\nfile C:\\Users\\PC\\AppData\\Local\\Temp\\PC\\mcrCache9.11\\MyIssv1\\MyIssvm\\tunelssvm.m, name @(x)simanncostfun2(x,model,costfun,costargs), line 168.\n at\nfile C:\\Users\\PC\\AppData\\Local\\Temp\\PC\\mcrCache9.11\\MyIssv1\\MyIssvm\\csa.m, name csa, line 30.\n at\nfile C:\\Users\\PC\\AppData\\Local\\Temp\\PC\\mcrCache9.11\\MyIssv1\\MyIssvm\\tunelssvm.m, name tunelssvm, line 168.\n at\nfile C:\\Users\\PC\\AppData\\Local\\Temp\\PC\\mcrCache9.11\\MyIssv1\\MyIssvm\\MyIssvm.m, name MyIssvm, line 46.\n\n"} System.Exception
这是C#里部分代码
MyLssvm ML = new MyLssvm();
double[,] xlssvm1 = new double[1, xlssvm.Length];
for (int i = 0; i < xlssvm.Length; i++)
{
xlssvm1[0, i] = xlssvm[i];
}
MWArray xlssvm2 = new MWNumericArray(xlssvm1);//类型转换
object yuce = ML.MyIssvm(xlssvm2);
我的解答思路和尝试过的方法,不写自己思路的,回答率下降 60%
我把LSSVM相关的函数都打包了,但是还是不行。