>>P=[1:2247,1:6]; %input
>>T=[1:2247,7:8]; %target
These are indices, not data matrices.
They are transposed. They should have the same number of rows.
>>a=[2188:2247,1:6]; %test input
>>s=[2188:2247,7:8]; %test target
Data division is done automatically see the documentation and demos
>>[pn1,PS] = mapminmax(P);
>>[tn1,TS] = mapminmax(T);
>>[an1,AS] = mapminmax(a);
>>[sn1,SS] = mapminmax(s);
Normalization is done automatically see the documentation and demos.
a and s must be normalized by the max and min of P and T
>>[pn1,tn1] = simplefit_dataset;
>>[an1,sn1] = simplefit_dataset;
They should not be the same data
>>net = feedforwardnet([8 4]);
One hidden layer is sufficient.
>>[net,TR]=train(net,pn1,tn1)
>>y2=sim(net,an1);
>>y2_again = mapminmax('reverse',y2',TS);
>>plot(y2_again,'r')
>>hold
>>plot(s)>>d=(y2_again-s).^2 >>mse1=mean(d)
Incorrect calculation of mse. Compare results with output of function mse.
Please go back to the documentation and demos before rewriting.
Make sure the code you post will run when cut and pasted into the command line.
Hope this helps.
Greg
