How to solve this error?

1 回表示 (過去 30 日間)
Akash Pal
Akash Pal 2022 年 5 月 12 日
コメント済み: Akash Pal 2022 年 5 月 12 日
Index in position 1 exceeds array bounds (must not exceed 17).
Everytime i am going to run my program i am getting this error ..How to solve it ?

採用された回答

KSSV
KSSV 2022 年 5 月 12 日
The error is clear. It seems you have an array of size 1x17 and you are trying to extract elements more than present in it.
% Example
A = rand(1,5) ; % aarray of size 1x5. It has only five elements
A(1) % no error
ans = 0.9122
A(5) % no error
ans = 0.0632
A(end) % no error
ans = 0.0632
A(6) % error, there is no sixth element and index should not exceed 5.
Index exceeds the number of array elements. Index must not exceed 5.
So, check your code for dimensions of the array from which you are accessing the elements.
  1 件のコメント
Akash Pal
Akash Pal 2022 年 5 月 12 日
Ok thank you so much .

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by