matlab的Vectors must be the same lengths.错误这个是我编写的一段程序,报了Vectors must be the same lengths错误,>> t=0:0.01:10;>> y=randn(size(t));>> yn=sin(y);>> p=y(1:30);>> t=yn(1:30);>> net=newff(minmax(p),[4,1],{'tansig','purelin'
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 03:14:18
matlab的Vectors must be the same lengths.错误这个是我编写的一段程序,报了Vectors must be the same lengths错误,>> t=0:0.01:10;>> y=randn(size(t));>> yn=sin(y);>> p=y(1:30);>> t=yn(1:30);>> net=newff(minmax(p),[4,1],{'tansig','purelin'
matlab的Vectors must be the same lengths.错误
这个是我编写的一段程序,报了Vectors must be the same lengths错误,
>> t=0:0.01:10;
>> y=randn(size(t));
>> yn=sin(y);
>> p=y(1:30);
>> t=yn(1:30);
>> net=newff(minmax(p),[4,1],{'tansig','purelin'},'trainlm');
>> net.trainParam.show=10;
>> net.trainParam.epochs=1000;
>> net.trainParam.goal=0.001;
>> net.trainParam.lr=0.01;
>> [net,tr]=train(net,p,t);
>> figure(1);
>> plotperf(tr);
>> a=sim(net,p);
>> figure(2);
>> plot([0:0.01:29],t,'-+',[0:0.01:2.9],a,'-*');
matlab的Vectors must be the same lengths.错误这个是我编写的一段程序,报了Vectors must be the same lengths错误,>> t=0:0.01:10;>> y=randn(size(t));>> yn=sin(y);>> p=y(1:30);>> t=yn(1:30);>> net=newff(minmax(p),[4,1],{'tansig','purelin'
最后一行 plot([0:0.01:29],t,'-+',[0:0.01:2.9],a,'-*');
一个是29 一个是2.9 ,或许是输入失误.