我用MATLAB教程上用的模板套用可是只能拟合不能预测~~怎么破?
clear
clc
p0 = [0.713 0.635 0.718 0.769 0.786 0.791 0.814 ];
for i= 1:4
p(:,i)=[p0(i) p0(i+1)]';
t(i)=p0(i+2);
end
net=newff(minmax(p),[5,1],{'logsig','purelin'},'trainlm');
net.trainParam.show=100;
net.trainParam.epoch=10000;
net.trainParam.goal=1e-4;
[net,tr]=train(net,p,t);
ptest(:,1)=[p0(5) p0(6)]';
ttest(1)=p0(7);
result_test = sim(net,p);
result_test1 = sim(net,ptest);
delta = result_test1-ttest;
result_test
delta
result = [result_test result_test1];
plot([2004:2008],p0(3:7),'-+',[2004:2008],result,'-go')