Error 1 exceed array bound
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
aymane souani
2019 年 5 月 16 日
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,:).
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!