Filter löschen
Filter löschen

Forecasting BOD values using MATLAB neural net toolbox

2 Ansichten (letzte 30 Tage)
Yeasir Mohammad Akib
Yeasir Mohammad Akib am 17 Dez. 2015
Beantwortet: Greg Heath am 18 Dez. 2015
My code is here but I have faced problem with the output.
Input
x=load('BOD test.txt');
T = x;
net = narnet(1:2,10);
[Xs,Xi,Ai,Ts] = preparets(net,{},{},T);
net = train(net,Xs,Ts,Xi,Ai);
view(net)
Y = net(Xs,Xi,Ai);
plotresponse(T,Y)
Output
Index exceeds matrix dimensions.
Error in preparets (line 293)
xi = xx(:,FBS+((1-net.numInputDelays):0));
Error in riverdata (line 5)
[Xs,Xi,Ai,Ts] = preparets(net,{},{},T);
here is the txt file of BOD (1*18 matrix).

Akzeptierte Antwort

Greg Heath
Greg Heath am 18 Dez. 2015
ALWAYS use the function WHOS to keep track of size and class for all variables. Then you would see that T and Y are not the same size. I consider it a typo that the syntax Y is used instead of Ys. Use the following
Ys = net(Xs,Xi,Ai);
plotresponse(Ts,Ys)
P.S. N = 18 is not long enough for a worthwile example
Hope this helps.
Thank you for formally accepting my answer
Greg

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by