Index in position 1 exceeds array bounds (must not exceed 2) error using nftool fitnet

2 Ansichten (letzte 30 Tage)
Hello,
I am trying to run the nftool examples and I am getting an error 'Index in position 1 exceeds array bounds (must not exceed 2).' when using the nftool example data. The screen shots show the errors when using the abaloneinputs/targets data set .
Using fitnet from the commandline with the same data also gives the error. I would appreciate any help to figure out what is going wrong here.
thank you
Saikat Sengupta.
  3 Kommentare
Saikat Sengupta
Saikat Sengupta am 31 Aug. 2023
Bearbeitet: Saikat Sengupta am 31 Aug. 2023
Hi Dyuman,
Thanks for your answer.I appreciate you help. However, I am running a standard matlab toolbox example. That should not produce this error.
Saikat
Dyuman Joshi
Dyuman Joshi am 31 Aug. 2023
"However, I am running a standard matlab toolbox example."
Idk how that is related to the error obtained.
"That should not produce this error."
What makes you think so?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Prateekshya
Prateekshya am 5 Sep. 2023
Bearbeitet: Prateekshya am 5 Sep. 2023
Hi Saikat,
As per my understanding, you are getting an "index exceeds array bounds" error at line 176 which is:
range(inputStart(j):inputStop(j),:) = temp2((inputStart(j)-inputStop(j))-inputStart(j)+1,:);
It seems there is some issue in the indexing and not the standard toolbox example. One way to debug the above line is to print the variables individually with the corresponding indices to see which of them is causing the error. You may try adding something as mentioned below before line 176. The final code will be:
inputStart(j)
inputStop(j)
(inputStart(j):inputStop(j))-inputStart(j)
range(inputStart(j):inputStop(j),:) = temp2((inputStart(j)-inputStop(j))-inputStart(j)+1,:);
If any of the above statements cause the same error, you should make necessary changes to the indices in order to avoid the error. If the above statements are working fine, then try adding these statements further:
% inputStart(j)
% inputStop(j)
% (inputStart(j):inputStop(j))-inputStart(j)[DJ1] [DJ2]
range(inputStart(j):inputStop(j),:)
temp2((inputStart(j)-inputStop(j))-inputStart(j)+1,:)
range(inputStart(j):inputStop(j),:) = temp2((inputStart(j)-inputStop(j))-inputStart(j)+1,:);
You may or may not comment out the first three lines. By following this process, you will be able to figure out for which variable the index is exceeding the bounds which will help you in avoiding the error.
Hope this helps!

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by