matlab 7.8版本 就是2009a 的版本,这段程序哪位大虾帮忙看看,有好多错误,我不懂,菜鸟..clear all;p=[50,0.1,11,32;30,0.05,9.5,29.5;70,0.16,13,34.5;30,0.16,9.5,34.5;70,0.05,13,29.5;15,0.01,4,20;100,1,20,50;15,1,4,50;100,0.01,20,2
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/19 23:25:33
matlab 7.8版本 就是2009a 的版本,这段程序哪位大虾帮忙看看,有好多错误,我不懂,菜鸟..clear all;p=[50,0.1,11,32;30,0.05,9.5,29.5;70,0.16,13,34.5;30,0.16,9.5,34.5;70,0.05,13,29.5;15,0.01,4,20;100,1,20,50;15,1,4,50;100,0.01,20,2
matlab 7.8版本 就是2009a 的版本,这段程序哪位大虾帮忙看看,有好多错误,我不懂,菜鸟..
clear all;
p=[50,0.1,11,32;30,0.05,9.5,29.5;70,0.16,13,34.5;30,0.16,9.5,34.5;70,0.05,13,29.5;15,0.01,4,20;100,1,20,50;15,1,4,50;100,0.01,20,20];
t=[0.1 0.2 0.2 0.2 0.2 0.3 0.3 0.3 0.3];
p=p'
[pn,minp,maxp]=mapminmax(p);
%创建BP网络和定义训练函数及参数
net=newff(minmax(pn),[8 1],{tansig',purelin'},trainlm');
net.trainparam.show=25;
net.trainparam.goal=0.0001;
net.trainparam.epochs=1000;
%训练神经网络
[net,tr]=train(net,p,t);
%输出训练后的权值和阈值
iw1=net.iw{1}
b1=net.b{1}
iw2=net.lw{2}
b2=net.b{2}
调到可以运行 我会追加分数的!
matlab 7.8版本 就是2009a 的版本,这段程序哪位大虾帮忙看看,有好多错误,我不懂,菜鸟..clear all;p=[50,0.1,11,32;30,0.05,9.5,29.5;70,0.16,13,34.5;30,0.16,9.5,34.5;70,0.05,13,29.5;15,0.01,4,20;100,1,20,50;15,1,4,50;100,0.01,20,2
clear all;
p=[50,0.1,11,32;30,0.05,9.5,29.5;70,0.16,13,34.5;30,0.16,9.5,34.5;70,0.05,13,29.5;15,0.01,4,20;100,1,20,50;15,1,4,50;100,0.01,20,20];
t=[0.1 0.2 0.2 0.2 0.2 0.3 0.3 0.3 0.3];
p=p'
[minp,maxp]=mapminmax(p);
%创建BP网络和定义训练函数及参数
net=newff(minmax(minp),[8 1],{'tansig','purelin'},'trainlm');
net.trainparam.show=25;
net.trainparam.goal=0.0001;
net.trainparam.epochs=1000;
%训练神经网络
[net,tr]=train(net,p,t);
%输出训练后的权值和阈值
iw1=net.iw{1}
b1=net.b{1}
iw2=net.lw{2}
b2=net.b{2}