Filter löschen
Filter löschen

Error 1 exceed array bound

1 Ansicht (letzte 30 Tage)
Tino
Tino am 16 Mai 2019
Kommentiert: Jan am 16 Mai 2019
Hi
Please find my code below
when I run the code, I am getting the error find below
Will appreciate your help
Tino
dists = squeeze(sqrt(sum((Train - permute(Test,[3,2,1])).^2,2)));
k = 1;
[d,ind] = sort(dists);
ind_closest = ind(1:k);
x_closest = x(ind_closest,:);
I am getting the error
Index in position 1 exceeds array bounds (must not exceed 1).
Error in practice (line 18)
x_closest = x(ind_closest,:);
  5 Kommentare
Tino
Tino am 16 Mai 2019
Not a problem Jan
Jan
Jan am 16 Mai 2019
Okay, thanks a lot, Steven. :-)

Melden Sie sich an, um zu kommentieren.

Antworten (1)

aymane souani
aymane souani am 16 Mai 2019
Hello.
I think that you should check your data in X.
You might exceed the range of your number of rows or that your x_closest hasn't the same size as x(ind_closest,:).

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by