双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

C#调用Matlab神经网络工具箱

wx23344842 wx23344842 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
用deploytool将M文件做成.dll文件,后用C#调用
提示错误... MWMCR::EvaluateFunction error ...
The left hand side is initialized and has an empty range of indices.
However, the right hand side returned one or more results.
Error in => BP_ANN_1.m at line 4.

其中M函数为
function y=BP_ANN_1(input,output,testIn,testOut)
input=input';output=output';
inputNorm=premnmx(input);
net=newff(minmax(input),[6 1],{'logsig' 'purelin'},'traingdx');
net.trainparam.epochs=10000;
net.trainparam.goal=0.001;
net.divideFcn = '';
net=train(net,inputNorm,output);
testIn=testIn';testOut=testOut';
testInNorm=premnmx(testIn);
y=sim(net,testInNorm);

C#程序为
MWNumericArray b = new MWNumericArray(MWArrayComplexity.Real, 4, 1);
MWNumericArray c = new MWNumericArray(MWArrayComplexity.Real, 2, 2);
MWNumericArray d = new MWNumericArray(MWArrayComplexity.Real, 2, 1);
a[1, 1] = 1; a[1, 2] = 1;
a[2, 1] = 0; a[2, 2] = 1;
a[3, 1] = 1; a[3, 2] = 0;
a[4, 1] = 0; a[4, 2] = 0;
b[1, 1] = 1; b[2, 1] = 0; b[3, 1] = 0; b[4, 1] = 0;
c[1, 1] = 1; c[2, 1] = 0;
c[2, 1] = 1; c[2, 2] = 1;
d[1, 1] = 0; d[2, 1] = 1;
bp.BP_ANN_1(a, b,c, d);

有没有做过这方面的大神给指条路啊!!!!!!!
...全文
评论 6
收藏 已收藏
分享
返回顶部
wx23344842
C# 111,129 成员 642,540 内容