i used nts tool to train a NN (narx). when i try to predict and plot i always get this error. index in position 2 exceeds array bounds (must not exceed 1).

1 view (last 30 days)
i have 1 input & 1 output csv files. the sizes were normally 1000x1 but i split them into cycles of 10 to give the network more samples to train so they became 100x10 double.
t11 = [];
yp11 = [];
for i = 1:20
[p1,Pi1,Ai1,t1] = preparets(netc,X(i,1),{},T(i,1));
t11 = [t1(i,:) t11];
yp1 = netc(p1,Pi1,Ai1);
yp11 = [yp1 yp11];
end
TS = size(t1,2);
plot(1:TS,cell2mat(t11),'b',1:TS,cell2mat(yp1),'r')
im using a different file to predict it and plot its prediction aganist itself so it is normally 200x1 but if i try to put it in a similar format as the files that trained the network its 20x10. in any case i get the same error in all formats and i dont understand why.
the goal is to plot it as one sin wave even if i trained it in cycles (one sin wave divided into many samples) and that is why the for loop is there to make sure it doesnt plot 10 sin waves.
This is the error i get.
Index in position 2 exceeds array bounds (must not exceed 1).
Error in preparets (line 317)
xi = xx(:,FBS+((1-net.numInputDelays):0));
Error in narxplotattempt (line 16)
[p1,Pi1,Ai1,t1] = preparets(netc,X(i,1),{},T(i,1));

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!